[Scipy-svn] r2496 - in trunk/Lib/sparse: . sparsetools tests

scipy-svn at scipy.org scipy-svn at scipy.org
Sat Jan 6 01:34:54 EST 2007


Author: wnbell
Date: 2007-01-06 00:34:41 -0600 (Sat, 06 Jan 2007)
New Revision: 2496

Added:
   trunk/Lib/sparse/sparsetools/complex_ops.h
   trunk/Lib/sparse/sparsetools/numpy.i
   trunk/Lib/sparse/sparsetools/sparsetools.h
   trunk/Lib/sparse/sparsetools/sparsetools.i
   trunk/Lib/sparse/sparsetools/sparsetools.py
   trunk/Lib/sparse/sparsetools/sparsetools_wrap.cxx
Removed:
   trunk/Lib/sparse/sparsetools.txt
   trunk/Lib/sparse/sparsetools/sparsetools.pyf.src
   trunk/Lib/sparse/sparsetools/spblas.f.src
   trunk/Lib/sparse/sparsetools/spconv.f.src
Modified:
   trunk/Lib/sparse/setup.py
   trunk/Lib/sparse/sparse.py
   trunk/Lib/sparse/tests/test_sparse.py
Log:
Rewrite of sparsetools. additional sparse unittests, and 
changes to sparse.py to interface w/ the new sparsetools



Modified: trunk/Lib/sparse/setup.py
===================================================================
--- trunk/Lib/sparse/setup.py	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/setup.py	2007-01-06 06:34:41 UTC (rev 2496)
@@ -15,10 +15,16 @@
     #                   sources = [join('sparsekit','*.f')]
     #                   )
 
-    sources = ['spblas.f.src','spconv.f.src','sparsetools.pyf.src']
+##    sources = ['spblas.f.src','spconv.f.src','sparsetools.pyf.src']
+##    sources = [join('sparsetools',x) for x in sources]
+
+##    config.add_extension('sparsetools',
+##                         sources =  sources,
+##                         )
+    sources = ['sparsetools_wrap.cxx','sparsetools.py']
     sources = [join('sparsetools',x) for x in sources]
 
-    config.add_extension('sparsetools',
+    config.add_extension('_sparsetools',
                          sources =  sources,
                          )
 

Modified: trunk/Lib/sparse/sparse.py
===================================================================
--- trunk/Lib/sparse/sparse.py	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/sparse.py	2007-01-06 06:34:41 UTC (rev 2496)
@@ -2,6 +2,7 @@
 
 Original code by Travis Oliphant.
 Modified and extended by Ed Schofield and Robert Cimrman.
+Revision of sparsetools by Nathan Bell
 """
 
 from numpy import zeros, isscalar, real, imag, asarray, asmatrix, matrix, \
@@ -23,14 +24,6 @@
 ALLOCSIZE=1000
 NZMAX = 100
 
-_coerce_rules = {('f', 'f'):'f', ('f', 'd'):'d', ('f', 'F'):'F',
-                 ('f', 'D'):'D', ('d', 'f'):'d', ('d', 'd'):'d',
-                 ('d', 'F'):'D', ('d', 'D'):'D', ('F', 'f'):'F',
-                 ('F', 'd'):'D', ('F', 'F'):'F', ('F', 'D'):'D',
-                 ('D', 'f'):'D', ('D', 'd'):'d', ('D', 'F'):'D',
-                 ('D', 'D'):'D'}
-_transtabl = {'f':'s', 'd':'d', 'F':'c', 'D':'z'}
-_itranstabl = {'s':'f', 'd':'d', 'c':'F', 'z':'D'}
 
 # The formats that we might potentially understand.
 _formats = {'csc':[0, "Compressed Sparse Column"],
@@ -55,6 +48,17 @@
             'und':[19, "Undefined"]
             }
 
+
+
+#these four  don't appear to be used anymore (Jan 6th, 2007)
+_coerce_rules = {('f', 'f'):'f', ('f', 'd'):'d', ('f', 'F'):'F',
+                 ('f', 'D'):'D', ('d', 'f'):'d', ('d', 'd'):'d',
+                 ('d', 'F'):'D', ('d', 'D'):'D', ('F', 'f'):'F',
+                 ('F', 'd'):'D', ('F', 'F'):'F', ('F', 'D'):'D',
+                 ('D', 'f'):'D', ('D', 'd'):'d', ('D', 'F'):'D',
+                 ('D', 'D'):'D'}
+_transtabl = {'f':'s', 'd':'d', 'F':'c', 'D':'z'}
+_itranstabl = {'s':'f', 'd':'d', 'c':'F', 'z':'D'}
 def _convert_data(data1, data2, newtype):
     if data1.dtype.char != newtype:
         data1 = data1.astype(newtype)
@@ -62,6 +66,9 @@
         data2 = data2.astype(newtype)
     return data1, data2
 
+
+
+
 class spmatrix(object):
     """ This class provides a base class for all sparse matrices.  It
     cannot be instantiated.  Most of the work is provided by subclasses.
@@ -476,25 +483,8 @@
                     # Use a double array as the source (but leave it alone)
                     s = s*1.0
                 if (rank(s) == 2):
-                    M, N = s.shape
-                    dtype = s.dtype
-                    func = getattr(sparsetools, _transtabl[dtype.char]+'fulltocsc')
-                    ierr = irow = jcol = 0
-                    nnz = (s != 0.0).sum()
-                    a = zeros((nnz,), self.dtype)
-                    rowa = zeros((nnz,), intc)
-                    ptra = zeros((N+1,), intc)
-                    while 1:
-                        a, rowa, ptra, irow, jcol, ierr = \
-                           func(s, a, rowa, ptra, irow, jcol, ierr)
-                        if (ierr == 0): break
-                        nnz = nnz + ALLOCSIZE
-                        a = resize1d(a, nnz)
-                        rowa = resize1d(rowa, nnz)
-                    self.data = a
-                    self.rowind = rowa
-                    self.indptr = ptra
-                    self.shape = (M, N)
+                    self.shape = s.shape
+                    self.indptr,self.rowind,self.data = sparsetools.densetocsr(s.shape[1],s.shape[0],s.T)
             else:
                 raise ValueError, "dense array must have rank 1 or 2"
         elif isspmatrix(arg1):
@@ -513,9 +503,7 @@
                     self.indptr = s.indptr
             elif isinstance(s, csr_matrix):
                 self.shape = s.shape
-                func = getattr(sparsetools, s.ftype+'transp')
-                self.data, self.rowind, self.indptr = \
-                           func(s.shape[1], s.data, s.colind, s.indptr)
+                self.indptr,self.rowind,self.data = sparsetools.csrtocsc(s.shape[0],s.shape[1],s.indptr,s.colind,s.data)
             else:
                 temp = s.tocsc()
                 self.data = temp.data
@@ -609,6 +597,10 @@
             raise ValueError, \
                   "Last value of index list should be less than "\
                   "the size of data list"
+        if (self.rowind.dtype != numpy.intc):
+            raise TypeError, "rowind indices must be of type numpy.intc"
+        if (self.indptr.dtype != numpy.intc):
+            raise TypeError, "inptr indices must be of type numpy.intc"
         self.nnz = nnz
         self.nzmax = nzmax
         self.dtype = self.data.dtype
@@ -641,18 +633,10 @@
             ocs = other.tocsc()
             if (ocs.shape != self.shape):
                 raise ValueError, "inconsistent shapes"
-            dtypechar = _coerce_rules[(self.dtype.char, ocs.dtype.char)]
-            nnz1, nnz2 = self.nnz, ocs.nnz
-            if (nnz1 == 0): nnz1 = 1
-            if (nnz2 == 0): nnz2 = 1
-            data1, data2 = _convert_data(self.data[:nnz1], ocs.data[:nnz2], dtypechar)
-            func = getattr(sparsetools, _transtabl[dtypechar]+'cscadd')
-            c, rowc, ptrc, ierr = func(data1, self.rowind[:nnz1], self.indptr,
-                                       data2, ocs.rowind[:nnz2], ocs.indptr)
-            if ierr:
-                raise RuntimeError, "ran out of space"
-            M, N = self.shape
-            return csc_matrix((c, rowc, ptrc), dims=(M, N))
+            indptr,rowind,data = sparsetools.cscplcsc(self.shape[0],self.shape[1], \
+                                                    self.indptr,self.rowind,self.data,\
+                                                      ocs.indptr,ocs.rowind,ocs.data)
+            return csc_matrix((data,rowind,indptr),self.shape)
         elif isdense(other):
             # Convert this matrix to a dense matrix and add them.
             return self.todense() + other
@@ -667,18 +651,10 @@
             ocs = other.tocsc()
             if (ocs.shape != self.shape):
                 raise ValueError, "inconsistent shapes"
-            dtypechar = _coerce_rules[(self.dtype.char, ocs.dtype.char)]
-            nnz1, nnz2 = self.nnz, ocs.nnz
-            if (nnz1 == 0): nnz1=1
-            if (nnz2 == 0): nnz2=1
-            data1, data2 = _convert_data(self.data[:nnz1], ocs.data[:nnz2], dtypechar)
-            func = getattr(sparsetools, _transtabl[dtypechar]+'cscadd')
-            c, rowc, ptrc, ierr = func(data1, self.rowind[:nnz1], self.indptr,
-                                       data2, ocs.rowind[:nnz2], ocs.indptr)
-            if ierr:
-                raise RuntimeError, "ran out of space"
-            M, N = self.shape
-            return csc_matrix((c, rowc, ptrc), dims=(M, N))
+            indptr,rowind,data = sparsetools.cscplcsc(self.shape[0],self.shape[1], \
+                                                             self.indptr,self.rowind,self.data,\
+                                                             ocs.indptr,ocs.rowind,ocs.data)
+            return csc_matrix((data,rowind,indptr),self.shape)
         elif isdense(other):
             # Convert this matrix to a dense matrix and add them
             return other + self.todense()
@@ -731,15 +707,10 @@
             ocs = other.tocsc()
             if (ocs.shape != self.shape):
                 raise ValueError, "inconsistent shapes"
-            dtypechar = _coerce_rules[(self.dtype.char, ocs.dtype.char)]
-            nnz1, nnz2 = self.nnz, ocs.nnz
-            data1, data2 = _convert_data(self.data[:nnz1], ocs.data[:nnz2], dtypechar)
-            func = getattr(sparsetools, _transtabl[dtypechar]+'cscmul')
-            c, rowc, ptrc, ierr = func(data1, self.rowind[:nnz1], self.indptr, data2, ocs.rowind[:nnz2], ocs.indptr)
-            if ierr:
-                raise RuntimeError, "ran out of space"
-            M, N = self.shape
-            return csc_matrix((c, rowc, ptrc), dims=(M, N))
+            indptr,rowind,data = sparsetools.cscelmulcsc(self.shape[0],self.shape[1],\
+                                                         self.indptr,self.rowind,self.data,\
+                                                         ocs.indptr,ocs.rowind,ocs.data)
+            return csc_matrix((data,rowind,indptr),(self.shape[0],ocs.shape[1]))
 
     def transpose(self, copy=False):
         M, N = self.shape
@@ -801,8 +772,9 @@
             # being created on-the-fly like with dense matrix objects.
             #if len(other) != self.shape[1]:
             #    raise ValueError, "dimension mismatch"
-            func = getattr(sparsetools, self.ftype+'cscmux')
-            y = func(self.data, self.rowind, self.indptr, other, self.shape[0])
+            oth = numpy.ravel(other)
+            y = sparsetools.cscmux(self.shape[0],self.shape[1],\
+                                   self.indptr,self.rowind,self.data,oth)
             if isinstance(other, matrix):
                 y = asmatrix(y)
                 # If 'other' was an (nx1) column vector, transpose the result
@@ -821,13 +793,12 @@
             # being created on-the-fly like with dense matrix objects.
             #if len(other) != self.shape[0]:
             #    raise ValueError, "dimension mismatch"
-            func = getattr(sparsetools, self.ftype+'csrmux')
+            oth = numpy.ravel(other)
             if conjugate:
                 cd = conj(self.data)
             else:
                 cd = self.data
-            y = func(cd, self.rowind, self.indptr, other)
-
+            y = sparsetool.csrmux(self.shape[1],self.shape[0],self.indptr,self.rowind,cd,oth)
             if isinstance(other, matrix):
                 y = asmatrix(y)
                 # In the (unlikely) event that this matrix is 1x1 and 'other' was an
@@ -846,51 +817,10 @@
             K2, N = other.shape
             if (K1 != K2):
                 raise ValueError, "shape mismatch error"
-            a, rowa, ptra = self.data, self.rowind, self.indptr
-            if isinstance(other, csr_matrix):
-                other._check()
-                dtypechar = _coerce_rules[(self.dtype.char, other.dtype.char)]
-                ftype = _transtabl[dtypechar]
-                func = getattr(sparsetools, ftype+'cscmucsr')
-                b = other.data
-                rowb = other.colind
-                ptrb = other.indptr
-            elif isinstance(other, csc_matrix):
-                other._check()
-                dtypechar = _coerce_rules[(self.dtype.char, other.dtype.char)]
-                ftype = _transtabl[dtypechar]
-                func = getattr(sparsetools, ftype+'cscmucsc')
-                b = other.data
-                rowb = other.rowind
-                ptrb = other.indptr
-            else:
-                other = other.tocsc()
-                dtypechar = _coerce_rules[(self.dtype.char, other.dtype.char)]
-                ftype = _transtabl[dtypechar]
-                func = getattr(sparsetools, ftype+'cscmucsc')
-                b = other.data
-                rowb = other.rowind
-                ptrb = other.indptr
-            a, b = _convert_data(a, b, dtypechar)
-            ptrc = zeros((N+1,), intc)
-            nnzc = 2*max(ptra[-1], ptrb[-1])
-            c = zeros((nnzc,), dtypechar)
-            rowc = zeros((nnzc,), intc)
-            ierr = irow = kcol = 0
-            while True: # loop in case first call runs out of memory.
-                c, rowc, ptrc, irow, kcol, ierr = func(M, a, rowa, ptra, b,
-                                                       rowb, ptrb, c, rowc,
-                                                       ptrc, irow, kcol, ierr)
-                if (ierr==0): break
-                # otherwise we were too small and must resize arrays
-                #  calculations continue where they left off...
-                print "Resizing...", kcol, irow, ierr
-                percent_to_go = 1- (1.0*kcol*M + irow) / (N*M)
-                newnnzc = int(ceil((1+percent_to_go)*nnzc))
-                c = resize1d(c, newnnzc)
-                rowc = resize1d(rowc, newnnzc)
-                nnzc = newnnzc
-            return csc_matrix((c, rowc, ptrc), dims=(M, N))
+            other = other.tocsc()
+            indptr,rowind,data = sparsetools.cscmucsc(M,N,self.indptr,self.rowind,self.data,\
+                                                             other.indptr,other.rowind,other.data)
+            return csc_matrix((data,rowind,indptr),(M,N))      
         elif isdense(other):
             # This is SLOW!  We need a more efficient implementation
             # of sparse * dense matrix multiplication!
@@ -915,9 +845,12 @@
                 col = N + col
             if not (0<=row<M) or not (0<=col<N):
                 raise IndexError, "index out of bounds"
-            func = getattr(sparsetools, self.ftype+'cscgetel')
-            ind, val = func(self.data, self.rowind, self.indptr, row, col)
-            return val
+            #this was implemented in fortran before - is there a noticable performance advangate?
+            indxs = numpy.where(row == self.rowind[self.indptr[col]:self.indptr[col+1]])
+            if len(indxs[0]) == 0:
+                return 0
+            else:
+                return self.data[self.indptr[col]:self.indptr[col+1]][indxs[0]]
         elif isintlike(key):
             # Was: return self.data[key]
             # If this is allowed, it should return the relevant row, as for
@@ -931,7 +864,6 @@
         if isinstance(key, tuple):
             row = key[0]
             col = key[1]
-            func = getattr(sparsetools, self.ftype+'cscsetel')
             M, N = self.shape
             if (row < 0):
                 row = M + row
@@ -946,12 +878,30 @@
             if (row >= M):
                 M = row+1
             self.shape = (M, N)
-            nzmax = self.nzmax
-            if (nzmax < self.nnz+1):  # need more room
-                alloc = max(1, self.allocsize)
-                self.data = resize1d(self.data, nzmax + alloc)
-                self.rowind = resize1d(self.rowind, nzmax + alloc)
-            func(self.data, self.rowind, self.indptr, row, col, val)
+
+            indxs = numpy.where(row == self.rowind[self.indptr[col]:self.indptr[col+1]])
+            if len(indxs[0]) == 0:
+                #value not present
+                nzmax = self.nzmax
+                if (nzmax < self.nnz+1):  # need more room
+                    alloc = max(1, self.allocsize)
+                    self.data = resize1d(self.data, nzmax + alloc)
+                    self.rowind = resize1d(self.rowind, nzmax + alloc)
+                    
+                newindex = self.indptr[col]
+                self.data[newindex+1:]   = self.data[newindex:-1]
+                self.rowind[newindex+1:] = self.rowind[newindex:-1]
+                
+                self.data[newindex]   = val
+                self.rowind[newindex] = row
+                self.indptr[col+1:] += 1
+                
+            elif len(indxs[0]) == 1:
+                #value already present
+                self.data[self.indptr[col]:self.indptr[col+1]][indxs[0]] = val
+            else:
+                raise IndexError, "row index occurs more than once"
+            
             self._check()
         else:
             # We should allow slices here!
@@ -966,31 +916,18 @@
         if stop <= start:
             raise ValueError, "slice width must be >= 1"
         startind = -1
-        # Locate the first element in self.data
-        # (could be made more efficient with a binary search)
-        for ind in xrange(self.indptr[j], self.indptr[j+1]):
-            if self.rowind[ind] >= start:
-                startind = ind
-                break
-        if startind == -1:
-            # Col has only zeros
-            return csc_matrix((stop-start, 1), dtype=self.dtype, \
-                              nzmax=min(NZMAX, stop-start))
+
+        indices = []
         
-        stopind = self.indptr[j+1]
-        # Locate the last+1 index into self.data
-        # (could be made more efficient with a binary search)
-        for ind in xrange(startind, self.indptr[j+1]):
-            if self.rowind[ind] >= stop:
-                stopind = ind
-                break
-                
-        data = self.data[startind : stopind]
-        rowind = self.rowind[startind : stopind] - start
-        indptr = numpy.array([0, stopind - startind])
-        new = csc_matrix((data, rowind, indptr), dims=(stop-start, 1), \
-                         dtype=self.dtype)
-        return new
+        for ind in xrange(self.indptr[j], self.indptr[j+1]):
+            if self.rowind[ind] >= start and self.rowind[ind] < stop:
+                indices.append(ind)
+
+        rowind = self.rowind[indices] - start
+        data   = self.data[indices]
+        indptr = numpy.array([0,len(indices)])
+        return csc_matrix((data, rowind, indptr), dims=(stop-start, 1), \
+                          dtype=self.dtype)
     
     def rowcol(self, ind):
         row = self.rowind[ind]
@@ -1008,19 +945,16 @@
         return new
 
     def tocoo(self):
-        if self.nnz == 0:
-            return coo_matrix(None, dims=self.shape, dtype=self.dtype)
-        else:
-            func = getattr(sparsetools, self.ftype+"csctocoo")
-            data, row, col = func(self.data, self.rowind, self.indptr)
-            return coo_matrix((data, (row, col)), dims=self.shape)
+        rows,cols,data = sparsetools.csctocoo(self.shape[0],self.shape[1],\
+                                              self.indptr,self.rowind,self.data)
+        return coo_matrix((data,(rows,cols)),self.shape)
 
     def tocsr(self):
-        return self.tocoo().tocsr()
-
+        indptr,colind,data = sparsetools.csctocsr(self.shape[0],self.shape[1],self.indptr,self.rowind,self.data)
+        return csr_matrix((data,colind,indptr),self.shape)
+    
     def toarray(self):
-        func = getattr(sparsetools, self.ftype+'csctofull')
-        return func(self.shape[0], self.data, self.rowind, self.indptr)
+        return self.tocsr().toarray()
 
     def prune(self):
         """ Remove empty space after all non-zero elements.
@@ -1097,11 +1031,6 @@
                     self.data = s.data
                     self.colind = s.colind
                     self.indptr = s.indptr
-            elif isinstance(s, csc_matrix):
-                self.shape = s.shape
-                func = getattr(sparsetools, s.ftype+'transp')
-                self.data, self.colind, self.indptr = \
-                           func(s.shape[1], s.data, s.rowind, s.indptr)
             else:
                 try:
                     temp = s.tocsr()
@@ -1196,6 +1125,10 @@
             raise ValueError, \
                   "last value of index list should be less than "\
                   "the size of data list"
+        if (self.colind.dtype != numpy.intc):
+            raise TypeError, "colind indices must be of type numpy.intc"
+        if (self.indptr.dtype != numpy.intc):
+            raise TypeError, "inptr indices must be of type numpy.intc"
         self.nnz = nnz
         self.nzmax = nzmax
         self.dtype = self.data.dtype
@@ -1226,19 +1159,12 @@
             raise NotImplementedError, 'adding a scalar to a CSR matrix ' \
                     'is not yet supported'
         elif isspmatrix(other):
-            ocs = other.tocsr()
-            if (ocs.shape != self.shape):
+            other = other.tocsr()
+            if (other.shape != self.shape):
                 raise ValueError, "inconsistent shapes"
-
-            dtypechar = _coerce_rules[(self.dtype.char, ocs.dtype.char)]
-            data1, data2 = _convert_data(self.data, ocs.data, dtypechar)
-            func = getattr(sparsetools, _transtabl[dtypechar]+'cscadd')
-            c, colc, ptrc, ierr = func(data1, self.colind, self.indptr, data2,
-                                       ocs.colind, ocs.indptr)
-            if ierr:
-                raise RuntimeError, "ran out of space"
-            M, N = self.shape
-            return csr_matrix((c, colc, ptrc), dims=(M, N))
+            indptr,colind,data = sparsetools.csrplcsr(self.shape[0],other.shape[1],\
+                                                      self.indptr,self.colind,self.data,other.indptr,other.colind,other.data)
+            return csr_matrix((data,colind,indptr),self.shape)
         elif isdense(other):
             # Convert this matrix to a dense matrix and add them.
             return self.todense() + other
@@ -1288,18 +1214,13 @@
             new.ftype = _transtabl[new.dtype.char]
             return new
         elif isspmatrix(other):
-            ocs = other.tocsr()
-            if (ocs.shape != self.shape):
+            other = other.tocsr()
+            if (other.shape != self.shape):
                 raise ValueError, "inconsistent shapes"
-            dtypechar = _coerce_rules[(self.dtype.char, ocs.dtype.char)]
-            data1, data2 = _convert_data(self.data, ocs.data, dtypechar)
-            func = getattr(sparsetools, _transtabl[dtypechar]+'cscmul')
-            c, colc, ptrc, ierr = func(data1, self.colind, self.indptr, data2,
-                                       ocs.colind, ocs.indptr)
-            if ierr:
-                raise RuntimeError, "ran out of space"
-            M, N = self.shape
-            return csr_matrix((c, colc, ptrc), dims=(M, N))
+            indptr,colind,data = sparsetools.csrelmulcsr(self.shape[0],other.shape[1],\
+                                                         self.indptr,self.colind,self.data,\
+                                                         other.indptr,other.colind,other.data)
+            return csr_matrix((data,colind,indptr),(self.shape[0],other.shape[1]))
         else:
             raise TypeError, "unsupported type for sparse matrix power"
 
@@ -1349,9 +1270,8 @@
             # being created on-the-fly like dense matrix objects can.
             #if len(other) != self.shape[1]:
             #    raise ValueError, "dimension mismatch"
-            func = getattr(sparsetools, self.ftype+'csrmux')
-            y = func(self.data, self.colind, self.indptr, other)
-
+            oth = numpy.ravel(other)            
+            y = sparsetools.csrmux(self.shape[0],self.shape[1],self.indptr,self.colind,self.data,oth)
             if isinstance(other, matrix):
                 y = asmatrix(y)
                 # If 'other' was an (nx1) column vector, transpose the result
@@ -1370,8 +1290,9 @@
             cd = conj(self.data)
         else:
             cd = self.data
-        y = func(cd, self.colind, self.indptr, other, self.shape[1])
 
+        oth = numpy.ravel(other)            
+        y = sparsetools.cscmux(self.shape[0],self.shape[1],self.indptr,self.rowind,cd,oth)
         if isinstance(other, matrix):
             y = asmatrix(y)
             # In the (unlikely) event that this matrix is 1x1 and 'other' was an
@@ -1387,69 +1308,11 @@
             a, rowa, ptra = self.data, self.colind, self.indptr
             if (K1 != K2):
                 raise ValueError, "shape mismatch error"
-            if isinstance(other, csc_matrix):
-                other._check()
-                dtypechar = _coerce_rules[(self.dtype.char, other.dtype.char)]
-                ftype = _transtabl[dtypechar]
-                func = getattr(sparsetools, ftype+'csrmucsc')
-                b = other.data
-                colb = other.rowind
-                ptrb = other.indptr
-                out = 'csc'
-                firstarg = ()
-            elif isinstance(other, csr_matrix):
-                other._check()
-                dtypechar = _coerce_rules[(self.dtype.char, other.dtype.char)]
-                ftype = _transtabl[dtypechar]
-                func = getattr(sparsetools, ftype+'cscmucsc')
-                b, colb, ptrb = a, rowa, ptra
-                a, rowa, ptra = other.data, other.colind, other.indptr
-                out = 'csr'
-                firstarg = (N,)
-            else:
-                other = other.tocsc()
-                dtypechar = _coerce_rules[(self.dtype.char, other.dtype.char)]
-                ftype = _transtabl[dtypechar]
-                func = getattr(sparsetools, ftype+'csrmucsc')
-                b = other.data
-                colb = other.rowind
-                ptrb = other.indptr
-                out = 'csc'
-                firstarg = ()
-            a, b = _convert_data(a, b, dtypechar)
-            newshape = (M, N)
-            if out == 'csr':
-                ptrc = zeros((M+1,), intc)
-            else:
-                ptrc = zeros((N+1,), intc)
-            nnzc = 2*max(ptra[-1], ptrb[-1])
-            # Avoid an infinite loop when multiplying by a matrix with
-            # only zeros
-            if nnzc == 0:
-                if out == 'csr':
-                    return csr_matrix(newshape, dtype=dtypechar)
-                else:
-                    return csc_matrix(newshape, dtype=dtypechar)
-            c = zeros((nnzc,), dtypechar)
-            rowc = zeros((nnzc,), intc)
-            ierr = irow = kcol = 0
-            while 1:
-                args = firstarg+(a, rowa, ptra, b, colb, ptrb, c, rowc, ptrc, irow,
-                                 kcol, ierr)
-                c, rowc, ptrc, irow, kcol, ierr = func(*args)
-                if (ierr==0): break
-                # otherwise we were too small and must resize
-                percent_to_go = 1- (1.0*kcol) / N
-                newnnzc = int(ceil((1+percent_to_go)*nnzc))
-                c = resize1d(c, newnnzc)
-                rowc = resize1d(rowc, newnnzc)
-                nnzc = newnnzc
-            
-            if out == 'csr':
-                # Note: 'rowc' is deliberate
-                return csr_matrix((c, rowc, ptrc), dims=(M, N))
-            else:
-                return csc_matrix((c, rowc, ptrc), dims=(M, N))
+            other = other.tocsr()
+            indptr,colind,data = sparsetools.csrmucsr(self.shape[0],other.shape[1],\
+                                                      self.indptr,self.colind,self.data,\
+                                                      other.indptr,other.colind,other.data)
+            return csr_matrix((data,colind,indptr),(self.shape[0],other.shape[1]))
         elif isdense(other):
             # This is SLOW!  We need a more efficient implementation
             # of sparse * dense matrix multiplication!
@@ -1474,9 +1337,12 @@
                 col = N + col
             if not (0<=row<M) or not (0<=col<N):
                 raise IndexError, "index out of bounds"
-            func = getattr(sparsetools, self.ftype+'cscgetel')
-            ind, val = func(self.data, self.colind, self.indptr, col, row)
-            return val
+
+            indxs = numpy.where(col == self.colind[self.indptr[row]:self.indptr[row+1]])
+            if len(indxs[0]) == 0:
+                return 0
+            else:
+                return self.data[self.indptr[row]:self.indptr[row+1]][indxs[0]]
         elif isintlike(key):
             return self[key, :]
         else:
@@ -1492,37 +1358,23 @@
         if stop <= start:
             raise ValueError, "slice width must be >= 1"
         startind = -1
-        # Locate the first element in self.data
-        # (could be made more efficient with a binary search)
-        for ind in xrange(self.indptr[i], self.indptr[i+1]):
-            if self.colind[ind] >= start:
-                startind = ind
-                break
-        if startind == -1:
-            # Row has only zeros
-            return csr_matrix((1, stop-start), dtype=self.dtype, \
-                              nzmax=min(NZMAX, stop-start))
+
+        indices = []
         
-        stopind = self.indptr[i+1]
-        # Locate the last+1 index into self.data
-        # (could be made more efficient with a binary search)
-        for ind in xrange(startind, self.indptr[i+1]):
-            if self.colind[ind] >= stop:
-                stopind = ind
-                break
-                
-        data = self.data[startind : stopind]
-        colind = self.colind[startind : stopind] - start
-        indptr = numpy.array([0, stopind - startind])
-        new = csr_matrix((data, colind, indptr), dims=(1, stop-start), \
-                         dtype=self.dtype)
-        return new
+        for ind in xrange(self.indptr[i], self.indptr[i+1]):
+            if self.colind[ind] >= start and self.colind[ind] < stop:
+                indices.append(ind)
+
+        colind = self.colind[indices] - start
+        data   = self.data[indices]
+        indptr = numpy.array([0,len(indices)])
+        return csr_matrix((data, colind, indptr), dims=(1,stop-start), \
+                          dtype=self.dtype)
     
     def __setitem__(self, key, val):
         if isinstance(key, tuple):
             row = key[0]
             col = key[1]
-            func = getattr(sparsetools, self.ftype+'cscsetel')
             M, N = self.shape
             if (row < 0):
                 row = M + row
@@ -1534,19 +1386,33 @@
                 self.indptr = resize1d(self.indptr, row+2)
                 self.indptr[M+1:] = self.indptr[M]
                 M = row+1
-            elif (row < 0):
-                row = M - row
             if (col >= N):
                 N = col+1
-            elif (col < 0):
-                col = N - col
             self.shape = (M, N)
-            nzmax = self.nzmax
-            if (nzmax < self.nnz+1):  # need more room
-                alloc = max(1, self.allocsize)
-                self.data = resize1d(self.data, nzmax + alloc)
-                self.colind = resize1d(self.colind, nzmax + alloc)
-            func(self.data, self.colind, self.indptr, col, row, val)
+
+            indxs = numpy.where(col == self.colind[self.indptr[row]:self.indptr[row+1]])
+            if len(indxs[0]) == 0:
+                #value not present
+                nzmax = self.nzmax
+                if (nzmax < self.nnz+1):  # need more room
+                    alloc = max(1, self.allocsize)
+                    self.data = resize1d(self.data, nzmax + alloc)
+                    self.colind = resize1d(self.colind, nzmax + alloc)
+                    
+                newindex = self.indptr[row]
+                self.data[newindex+1:]   = self.data[newindex:-1]
+                self.colind[newindex+1:] = self.colind[newindex:-1]
+                
+                self.data[newindex]   = val
+                self.colind[newindex] = col
+                self.indptr[row+1:] += 1
+                
+            elif len(indxs[0]) == 1:
+                #value already present
+                self.data[self.indptr[row]:self.indptr[row+1]][indxs[0]] = val
+            else:
+                raise IndexError, "row index occurs more than once"
+            
             self._check()
         else:
             # We should allow slices here!
@@ -1567,20 +1433,19 @@
             return self
 
     def tocoo(self):
-        if self.nnz == 0:
-            return coo_matrix(None, dims=self.shape, dtype=self.dtype)
-        else:
-            func = getattr(sparsetools, self.ftype+"csctocoo")
-            data, col, row = func(self.data, self.colind, self.indptr)
-            return coo_matrix((data, (row, col)), dims=self.shape)
+        rows,cols,data = sparsetools.csrtocoo(self.shape[0],self.shape[1],\
+                                              self.indptr,self.colind,self.data)
+        return coo_matrix((data,(rows,cols)),self.shape)
 
     def tocsc(self):
-        return self.tocoo().tocsc()
+        indptr,rowind,data = sparsetools.csrtocsc(self.shape[0],self.shape[1],self.indptr,self.colind,self.data)
+        return csc_matrix((data,rowind,indptr),self.shape)
 
+    
     def toarray(self):
-        func = getattr(sparsetools, self.ftype+'csctofull')
-        s = func(self.shape[1], self.data, self.colind, self.indptr)
-        return s.transpose()
+        data = numpy.zeros(self.shape,self.data.dtype)
+        sparsetools.csrtodense(self.shape[0],self.shape[1],self.indptr,self.colind,self.data,data)
+        return data
 
     def prune(self):
         """ Eliminate non-zero entries, leaving space for at least
@@ -1648,6 +1513,7 @@
                     assert M == int(M) and M > 0
                     assert N == int(N) and N > 0
                     self.shape = (int(M), int(N))
+                    return
                 except (TypeError, ValueError, AssertionError):
                     raise TypeError, "dimensions must be a 2-tuple of positive"\
                             " integers"
@@ -2057,6 +1923,7 @@
         base = dok_matrix()
         ext = dok_matrix()
         indx = int((columns == 1))
+        N = len(cols_or_rows)
         if indx:
             for key in self:
                 num = searchsorted(cols_or_rows, key[1])
@@ -2132,6 +1999,7 @@
             ikey0 = int(key[0])
             ikey1 = int(key[1])
             if ikey0 != current_row:
+                N = ikey0-current_row
                 row_ptr[current_row+1:ikey0+1] = k
                 current_row = ikey0
             data[k] = dict.__getitem__(self, key)
@@ -2164,6 +2032,7 @@
             ikey0 = int(key[0])
             ikey1 = int(key[1])
             if ikey1 != current_col:
+                N = ikey1-current_col
                 col_ptr[current_col+1:ikey1+1] = k
                 current_col = ikey1
             data[k] = self[key]
@@ -2272,6 +2141,10 @@
         if (nnz != len(self.row)) or (nnz != len(self.col)):
             raise ValueError, "row, column, and data array must all be "\
                   "the same length"
+        if (self.row.dtype != numpy.intc):
+            raise TypeError, "row indices must be of type numpy.intc"
+        if (self.col.dtype != numpy.intc):
+            raise TypeError, "col indices must be of type numpy.intc"
         self.nnz = nnz
         self.ftype = _transtabl.get(self.dtype.char,'')
 
@@ -2304,24 +2177,17 @@
         if self.nnz == 0:
             return csc_matrix(self.shape, dtype=self.dtype)
         else:
-            func = getattr(sparsetools, self.ftype+"cootocsc")
-            data, row, col = self._normalize()
-            a, rowa, ptra, ierr = func(self.shape[1], data, row, col)
-            if ierr:
-                raise RuntimeError, "error in conversion"
-            return csc_matrix((a, rowa, ptra), dims=self.shape)
+            indptr,rowind,data = sparsetools.cootocsc(self.shape[0],self.shape[1],self.size,self.row,self.col,self.data)        
+            return csc_matrix((data,rowind,indptr),self.shape)
 
+    
     def tocsr(self):
         if self.nnz == 0:
             return csr_matrix(self.shape, dtype=self.dtype)
         else:
-            func = getattr(sparsetools, self.ftype+"cootocsc")
-            data, row, col = self._normalize(rowfirst=True)
-            a, cola, ptra, ierr = func(self.shape[0], data, col, row)
-            if ierr:
-                raise RuntimeError, "error in conversion"
-            return csr_matrix((a, cola, ptra), dims=self.shape)
-
+            indptr,colind,data = sparsetools.cootocsr(self.shape[0],self.shape[1],self.size,self.row,self.col,self.data)        
+            return csr_matrix((data,colind,indptr),self.shape)
+            
     def tocoo(self, copy=False):
         if copy:
             return self.copy()
@@ -2811,15 +2677,10 @@
     if not hasattr(offsets, '__len__' ):
         offsets = (offsets,)
     offsets = array(offsets, copy=False)
-    mtype = diags.dtype.char
     assert(len(offsets) == diags.shape[0])
-    # set correct diagonal to csc conversion routine for this type
-    diagfunc = eval('sparsetools.'+_transtabl[mtype]+'diatocsc')
-    a, rowa, ptra, ierr = diagfunc(M, N, diags, offsets)
-    if ierr:
-        raise RuntimeError, "ran out of space"
-    return csc_matrix((a, rowa, ptra), dims=(M, N))
-
+    indptr,rowind,data = sparsetools.spdiags(M,N,len(offsets),offsets,diags)
+    return csc_matrix((data,rowind,indptr),(M,N))
+    
 def spidentity(n, dtype='d'):
     """
     spidentity( n ) returns the identity matrix of shape (n, n) stored

Added: trunk/Lib/sparse/sparsetools/complex_ops.h
===================================================================
--- trunk/Lib/sparse/sparsetools/complex_ops.h	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/sparsetools/complex_ops.h	2007-01-06 06:34:41 UTC (rev 2496)
@@ -0,0 +1,159 @@
+#ifndef COMPLEX_OPS_H
+#define COMPLEX_OPS_H
+
+/*
+ *  Functions to handle arithmetic operations on NumPy complex values
+ */
+
+
+
+
+/*
+ * Addition
+ */
+inline npy_cfloat operator+(const npy_cfloat& A, const npy_cfloat& B){
+  npy_cfloat result;
+  result.real = A.real + B.real;
+  result.imag = A.imag + B.imag;
+  return result;
+}
+inline npy_cdouble operator+(const npy_cdouble& A, const npy_cdouble& B){
+  npy_cdouble result;
+  result.real = A.real + B.real;
+  result.imag = A.imag + B.imag;
+  return result;
+}
+inline npy_clongdouble operator+(const npy_clongdouble& A, const npy_clongdouble& B){
+  npy_clongdouble result;
+  result.real = A.real + B.real;
+  result.imag = A.imag + B.imag;
+  return result;
+}
+
+inline npy_cfloat& operator+=(npy_cfloat& A, const npy_cfloat& B){
+  A.real += B.real;
+  A.imag += B.imag;
+  return A;
+}
+inline npy_cdouble& operator+=(npy_cdouble& A, const npy_cdouble& B){
+  A.real += B.real;
+  A.imag += B.imag;
+  return A;
+}
+inline npy_clongdouble& operator+=(npy_clongdouble& A, const npy_clongdouble& B){
+  A.real += B.real;
+  A.imag += B.imag;
+  return A;
+}
+
+/*
+ * Multiplication
+ */
+inline npy_cfloat operator*(const npy_cfloat& A, const npy_cfloat& B){
+  npy_cfloat result;
+  result.real = A.real * B.real - A.imag * B.imag;
+  result.imag = A.real * B.imag + A.imag * B.real;
+  return result;
+}
+inline npy_cdouble operator*(const npy_cdouble& A, const npy_cdouble& B){
+  npy_cdouble result;
+  result.real = A.real * B.real - A.imag * B.imag;
+  result.imag = A.real * B.imag + A.imag * B.real;
+  return result;
+}
+inline npy_clongdouble operator*(const npy_clongdouble& A, const npy_clongdouble& B){
+  npy_clongdouble result;
+  result.real = A.real * B.real - A.imag * B.imag;
+  result.imag = A.real * B.imag + A.imag * B.real;
+  return result;
+}
+
+inline npy_cfloat& operator*=(npy_cfloat& A, const npy_cfloat& B){
+  npy_float temp = A.real * B.real - A.imag * B.imag;
+  A.imag = A.real * B.imag + A.imag * B.real;
+  A.real = temp;
+  return A;
+}
+inline npy_cdouble& operator*=(npy_cdouble& A, const npy_cdouble& B){
+  npy_double temp = A.real * B.real - A.imag * B.imag;
+  A.imag = A.real * B.imag + A.imag * B.real;
+  A.real = temp;
+  return A;
+}
+inline npy_clongdouble& operator*=(npy_clongdouble& A, const npy_clongdouble& B){
+  npy_longdouble temp = A.real * B.real - A.imag * B.imag;
+  A.imag = A.real * B.imag + A.imag * B.real;
+  A.real = temp;
+  return A;
+}
+
+/*
+ * Equality (complex==complex)
+ */
+inline bool operator==(const npy_cfloat& A, const npy_cfloat& B){
+  return A.real == B.real && A.imag == B.imag;
+}
+inline bool operator==(const npy_cdouble& A, const npy_cdouble& B){
+  return A.real == B.real && A.imag == B.imag;
+}
+inline bool operator==(const npy_clongdouble& A, const npy_clongdouble& B){
+  return A.real == B.real && A.imag == B.imag;
+}
+
+inline bool operator!=(const npy_cfloat& A, const npy_cfloat& B){
+  return A.real != B.real || A.imag != B.imag;
+}
+inline bool operator!=(const npy_cdouble& A, const npy_cdouble& B){
+  return A.real != B.real || A.imag != B.imag;
+}
+inline bool operator!=(const npy_clongdouble& A, const npy_clongdouble& B){
+  return A.real != B.real || A.imag != B.imag;
+}
+
+/*
+ * Equality (complex==scalar)
+ */
+inline bool operator==(const npy_cfloat& A, const npy_float& B){
+  return A.real == B && A.imag == 0;
+}
+inline bool operator==(const npy_cdouble& A, const npy_double& B){
+  return A.real == B && A.imag == 0;
+}
+inline bool operator==(const npy_clongdouble& A, const npy_longdouble& B){
+  return A.real == B && A.imag == 0;
+}
+
+inline bool operator!=(const npy_cfloat& A, const npy_float& B){
+  return A.real != B || A.imag != 0;
+}
+inline bool operator!=(const npy_cdouble& A, const npy_double& B){
+  return A.real != B || A.imag != 0;
+}
+inline bool operator!=(const npy_clongdouble& A, const npy_longdouble& B){
+  return A.real != B || A.imag != 0;
+}
+
+/*
+ * Equality (scalar==complex)
+ */
+inline bool operator==(const npy_float& A, const npy_cfloat& B){
+  return A == B.real && 0 == B.imag;
+}
+inline bool operator==(const npy_double& A, const npy_cdouble& B){
+  return A == B.real && 0 == B.imag;
+}
+inline bool operator==(const npy_longdouble& A, const npy_clongdouble& B){
+  return A == B.real && 0 == B.imag;
+}
+
+inline bool operator!=(const npy_float& A, const npy_cfloat& B){
+  return A != B.real || 0 != B.imag;
+}
+inline bool operator!=(const npy_double& A, const npy_cdouble& B){
+  return A != B.real || 0 != B.imag;
+}
+inline bool operator!=(const npy_longdouble& A, const npy_clongdouble& B){
+  return A != B.real || 0 != B.imag;
+}
+
+#endif

Added: trunk/Lib/sparse/sparsetools/numpy.i
===================================================================
--- trunk/Lib/sparse/sparsetools/numpy.i	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/sparsetools/numpy.i	2007-01-06 06:34:41 UTC (rev 2496)
@@ -0,0 +1,563 @@
+/* -*- C -*-  (not really, but good for syntax highlighting) */
+%{
+#ifndef SWIG_FILE_WITH_INIT
+#  define NO_IMPORT_ARRAY
+#endif
+#include "stdio.h"
+#include <numpy/arrayobject.h>
+
+/* The following code originally appeared in enthought/kiva/agg/src/numeric.i,
+ * author unknown.  It was translated from C++ to C by John Hunter.  Bill
+ * Spotz has modified it slightly to fix some minor bugs, add some comments
+ * and some functionality.
+ */
+
+/* Macros to extract array attributes.
+ */
+#define is_array(a)            ((a) && PyArray_Check((PyArrayObject *)a))
+#define array_type(a)          (int)(PyArray_TYPE(a))
+#define array_dimensions(a)    (((PyArrayObject *)a)->nd)
+#define array_size(a,i)        (((PyArrayObject *)a)->dimensions[i])
+#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS(a))
+
+/* Given a PyObject, return a string describing its type.
+ */
+char* pytype_string(PyObject* py_obj) {
+  if (py_obj == NULL          ) return "C NULL value";
+  if (PyCallable_Check(py_obj)) return "callable"    ;
+  if (PyString_Check(  py_obj)) return "string"      ;
+  if (PyInt_Check(     py_obj)) return "int"         ;
+  if (PyFloat_Check(   py_obj)) return "float"       ;
+  if (PyDict_Check(    py_obj)) return "dict"        ;
+  if (PyList_Check(    py_obj)) return "list"        ;
+  if (PyTuple_Check(   py_obj)) return "tuple"       ;
+  if (PyFile_Check(    py_obj)) return "file"        ;
+  if (PyModule_Check(  py_obj)) return "module"      ;
+  if (PyInstance_Check(py_obj)) return "instance"    ;
+
+  return "unkown type";
+}
+
+/* Given a Numeric typecode, return a string describing the type.
+ */
+char* typecode_string(int typecode) {
+  char* type_names[20] = {"char","unsigned byte","byte","short",
+			  "unsigned short","int","unsigned int","long",
+			  "float","double","complex float","complex double",
+			  "object","ntype","unkown"};
+  return type_names[typecode];
+}
+
+/* Make sure input has correct numeric type.  Allow character and byte
+ * to match.  Also allow int and long to match.
+ */
+int type_match(int actual_type, int desired_type) {
+  return PyArray_EquivTypenums(actual_type, desired_type);
+}
+
+/* Given a PyObject pointer, cast it to a PyArrayObject pointer if
+ * legal.  If not, set the python error string appropriately and
+ * return NULL./
+ */
+PyArrayObject* obj_to_array_no_conversion(PyObject* input, int typecode) {
+  PyArrayObject* ary = NULL;
+  if (is_array(input) && (typecode == PyArray_NOTYPE || 
+			  PyArray_EquivTypenums(array_type(input), 
+						typecode))) {
+        ary = (PyArrayObject*) input;
+    }
+    else if is_array(input) {
+      char* desired_type = typecode_string(typecode);
+      char* actual_type = typecode_string(array_type(input));
+      PyErr_Format(PyExc_TypeError, 
+		   "Array of type '%s' required.  Array of type '%s' given", 
+		   desired_type, actual_type);
+      ary = NULL;
+    }
+    else {
+      char * desired_type = typecode_string(typecode);
+      char * actual_type = pytype_string(input);
+      PyErr_Format(PyExc_TypeError, 
+		   "Array of type '%s' required.  A %s was given", 
+		   desired_type, actual_type);
+      ary = NULL;
+    }
+  return ary;
+}
+
+/* Convert the given PyObject to a Numeric array with the given
+ * typecode.  On Success, return a valid PyArrayObject* with the
+ * correct type.  On failure, the python error string will be set and
+ * the routine returns NULL.
+ */
+PyArrayObject* obj_to_array_allow_conversion(PyObject* input, int typecode,
+                                             int* is_new_object)
+{
+  PyArrayObject* ary = NULL;
+  PyObject* py_obj;
+  if (is_array(input) && (typecode == PyArray_NOTYPE || type_match(array_type(input),typecode))) {
+    ary = (PyArrayObject*) input;
+    *is_new_object = 0;
+  }
+  else {
+    py_obj = PyArray_FromObject(input, typecode, 0, 0);
+    /* If NULL, PyArray_FromObject will have set python error value.*/
+    ary = (PyArrayObject*) py_obj;
+    *is_new_object = 1;
+  }
+  return ary;
+}
+
+/* Given a PyArrayObject, check to see if it is contiguous.  If so,
+ * return the input pointer and flag it as not a new object.  If it is
+ * not contiguous, create a new PyArrayObject using the original data,
+ * flag it as a new object and return the pointer.
+ */
+PyArrayObject* make_contiguous(PyArrayObject* ary, int* is_new_object,
+                               int min_dims, int max_dims)
+{
+  PyArrayObject* result;
+  if (array_is_contiguous(ary)) {
+    result = ary;
+    *is_new_object = 0;
+  }
+  else {
+    result = (PyArrayObject*) PyArray_ContiguousFromObject((PyObject*)ary, 
+							   array_type(ary), 
+							   min_dims,
+							   max_dims);
+    *is_new_object = 1;
+  }
+  return result;
+}
+
+/* Convert a given PyObject to a contiguous PyArrayObject of the
+ * specified type.  If the input object is not a contiguous
+ * PyArrayObject, a new one will be created and the new object flag
+ * will be set.
+ */
+PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject* input,
+                                                        int typecode,
+                                                        int* is_new_object) {
+  int is_new1 = 0;
+  int is_new2 = 0;
+  PyArrayObject* ary2;
+  PyArrayObject* ary1 = obj_to_array_allow_conversion(input, typecode, 
+						      &is_new1);
+  if (ary1) {
+    ary2 = make_contiguous(ary1, &is_new2, 0, 0);
+    if ( is_new1 && is_new2) {
+      Py_DECREF(ary1);
+    }
+    ary1 = ary2;    
+  }
+  *is_new_object = is_new1 || is_new2;
+  return ary1;
+}
+
+/* Test whether a python object is contiguous.  If array is
+ * contiguous, return 1.  Otherwise, set the python error string and
+ * return 0.
+ */
+int require_contiguous(PyArrayObject* ary) {
+  int contiguous = 1;
+  if (!array_is_contiguous(ary)) {
+    PyErr_SetString(PyExc_TypeError, "Array must be contiguous.  A discontiguous array was given");
+    contiguous = 0;
+  }
+  return contiguous;
+}
+
+/* Require the given PyArrayObject to have a specified number of
+ * dimensions.  If the array has the specified number of dimensions,
+ * return 1.  Otherwise, set the python error string and return 0.
+ */
+int require_dimensions(PyArrayObject* ary, int exact_dimensions) {
+  int success = 1;
+  if (array_dimensions(ary) != exact_dimensions) {
+    PyErr_Format(PyExc_TypeError, 
+		 "Array must be have %d dimensions.  Given array has %d dimensions", 
+		 exact_dimensions, array_dimensions(ary));
+    success = 0;
+  }
+  return success;
+}
+
+/* Require the given PyArrayObject to have one of a list of specified
+ * number of dimensions.  If the array has one of the specified number
+ * of dimensions, return 1.  Otherwise, set the python error string
+ * and return 0.
+ */
+int require_dimensions_n(PyArrayObject* ary, int* exact_dimensions, int n) {
+  int success = 0;
+  int i;
+  char dims_str[255] = "";
+  char s[255];
+  for (i = 0; i < n && !success; i++) {
+    if (array_dimensions(ary) == exact_dimensions[i]) {
+      success = 1;
+    }
+  }
+  if (!success) {
+    for (i = 0; i < n-1; i++) {
+      sprintf(s, "%d, ", exact_dimensions[i]);                
+      strcat(dims_str,s);
+    }
+    sprintf(s, " or %d", exact_dimensions[n-1]);            
+    strcat(dims_str,s);
+    PyErr_Format(PyExc_TypeError, 
+		 "Array must be have %s dimensions.  Given array has %d dimensions",
+		 dims_str, array_dimensions(ary));
+  }
+  return success;
+}    
+
+/* Require the given PyArrayObject to have a specified shape.  If the
+ * array has the specified shape, return 1.  Otherwise, set the python
+ * error string and return 0.
+ */
+int require_size(PyArrayObject* ary, int* size, int n) {
+  int i;
+  int success = 1;
+  int len;
+  char desired_dims[255] = "[";
+  char s[255];
+  char actual_dims[255] = "[";
+  for(i=0; i < n;i++) {
+    if (size[i] != -1 &&  size[i] != array_size(ary,i)) {
+      success = 0;    
+    }
+  }
+  if (!success) {
+    for (i = 0; i < n; i++) {
+      if (size[i] == -1) {
+	sprintf(s, "*,");                
+      }
+      else
+      {
+	sprintf(s, "%d,", size[i]);                
+      }    
+      strcat(desired_dims,s);
+    }
+    len = strlen(desired_dims);
+    desired_dims[len-1] = ']';
+    for (i = 0; i < n; i++) {
+      sprintf(s, "%d,", array_size(ary,i));                            
+      strcat(actual_dims,s);
+    }
+    len = strlen(actual_dims);
+    actual_dims[len-1] = ']';
+    PyErr_Format(PyExc_TypeError, 
+		 "Array must be have shape of %s.  Given array has shape of %s",
+		 desired_dims, actual_dims);
+  }
+  return success;
+}
+/* End John Hunter translation (with modifications by Bill Spotz) */
+
+%}
+
+/* TYPEMAP_IN macros
+ *
+ * This family of typemaps allows pure input C arguments of the form
+ *
+ *     (type* IN_ARRAY1, int DIM1)
+ *     (type* IN_ARRAY2, int DIM1, int DIM2)
+ *
+ * where "type" is any type supported by the Numeric module, to be
+ * called in python with an argument list of a single array (or any
+ * python object that can be passed to the Numeric.array constructor
+ * to produce an arrayof te specified shape).  This can be applied to
+ * a existing functions using the %apply directive:
+ *
+ *     %apply (double* IN_ARRAY1, int DIM1) {double* series, int length}
+ *     %apply (double* IN_ARRAY2, int DIM1, int DIM2) {double* mx, int rows, int cols}
+ *     double sum(double* series, int length);
+ *     double max(double* mx, int rows, int cols);
+ *
+ * or with
+ *
+ *     double sum(double* IN_ARRAY1, int DIM1);
+ *     double max(double* IN_ARRAY2, int DIM1, int DIM2);
+ */
+
+/* One dimensional input arrays */
+%define TYPEMAP_IN1(type,typecode)
+  %typemap(in) type* IN_ARRAY1 (PyArrayObject* array=NULL, int is_new_object) {
+  int size[1] = {-1};
+  array = obj_to_array_contiguous_allow_conversion($input, typecode, &is_new_object);
+  if (!array || !require_dimensions(array,1) || !require_size(array,size,1)) SWIG_fail;
+  $1 = (type*) array->data;
+}
+%typemap(freearg) type* IN_ARRAY1 {
+  if (is_new_object$argnum && array$argnum) Py_DECREF(array$argnum);
+}
+%enddef
+
+/* Define concrete examples of the TYPEMAP_IN1 macros */
+TYPEMAP_IN1(char,          PyArray_CHAR  )
+TYPEMAP_IN1(unsigned char, PyArray_UBYTE )
+TYPEMAP_IN1(signed char,   PyArray_SBYTE )
+TYPEMAP_IN1(short,         PyArray_SHORT )
+TYPEMAP_IN1(int,           PyArray_INT   )
+TYPEMAP_IN1(long,          PyArray_LONG  )
+TYPEMAP_IN1(float,         PyArray_FLOAT )
+TYPEMAP_IN1(double,        PyArray_DOUBLE)
+TYPEMAP_IN1(long double,        PyArray_LONGDOUBLE)
+TYPEMAP_IN1(npy_cfloat,         PyArray_CFLOAT )
+TYPEMAP_IN1(npy_cdouble,        PyArray_CDOUBLE)
+TYPEMAP_IN1(npy_clongdouble,    PyArray_CLONGDOUBLE)
+TYPEMAP_IN1(const char,          PyArray_CHAR  )
+TYPEMAP_IN1(const unsigned char, PyArray_UBYTE )
+TYPEMAP_IN1(const signed char,   PyArray_SBYTE )
+TYPEMAP_IN1(const short,         PyArray_SHORT )
+TYPEMAP_IN1(const int,           PyArray_INT   )
+TYPEMAP_IN1(const long,          PyArray_LONG  )
+TYPEMAP_IN1(const float,         PyArray_FLOAT )
+TYPEMAP_IN1(const double,        PyArray_DOUBLE)
+TYPEMAP_IN1(const long double,        PyArray_LONGDOUBLE)
+TYPEMAP_IN1(const npy_cfloat,         PyArray_CFLOAT )
+TYPEMAP_IN1(const npy_cdouble,        PyArray_CDOUBLE)
+TYPEMAP_IN1(const npy_clongdouble,    PyArray_CLONGDOUBLE)
+TYPEMAP_IN1(PyObject,      PyArray_OBJECT)
+
+#undef TYPEMAP_IN1
+
+
+
+
+ /* Two dimensional input arrays */
+%define TYPEMAP_IN2(type,typecode)
+  %typemap(in) (type* IN_ARRAY2)
+               (PyArrayObject* array=NULL, int is_new_object) {
+  int size[2] = {-1,-1};
+  array = obj_to_array_contiguous_allow_conversion($input, typecode, &is_new_object);
+  if (!array || !require_dimensions(array,2) || !require_size(array,size,1)) SWIG_fail;
+  $1 = (type*) array->data;
+}
+%typemap(freearg) (type* IN_ARRAY2) {
+  if (is_new_object$argnum && array$argnum) Py_DECREF(array$argnum);
+}
+%enddef
+
+/* Define concrete examples of the TYPEMAP_IN2 macros */
+TYPEMAP_IN2(char,          PyArray_CHAR  )
+TYPEMAP_IN2(unsigned char, PyArray_UBYTE )
+TYPEMAP_IN2(signed char,   PyArray_SBYTE )
+TYPEMAP_IN2(short,         PyArray_SHORT )
+TYPEMAP_IN2(int,           PyArray_INT   )
+TYPEMAP_IN2(long,          PyArray_LONG  )
+TYPEMAP_IN2(float,         PyArray_FLOAT )
+TYPEMAP_IN2(double,        PyArray_DOUBLE)
+TYPEMAP_IN2(long double,        PyArray_LONGDOUBLE)
+TYPEMAP_IN2(npy_cfloat,         PyArray_CFLOAT )
+TYPEMAP_IN2(npy_cdouble,        PyArray_CDOUBLE)
+TYPEMAP_IN2(npy_clongdouble,    PyArray_CLONGDOUBLE)
+TYPEMAP_IN2(const char,          PyArray_CHAR  )
+TYPEMAP_IN2(const unsigned char, PyArray_UBYTE )
+TYPEMAP_IN2(const signed char,   PyArray_SBYTE )
+TYPEMAP_IN2(const short,         PyArray_SHORT )
+TYPEMAP_IN2(const int,           PyArray_INT   )
+TYPEMAP_IN2(const long,          PyArray_LONG  )
+TYPEMAP_IN2(const float,         PyArray_FLOAT )
+TYPEMAP_IN2(const double,        PyArray_DOUBLE)
+TYPEMAP_IN2(const long double,        PyArray_LONGDOUBLE)
+TYPEMAP_IN2(const npy_cfloat,         PyArray_CFLOAT )
+TYPEMAP_IN2(const npy_cdouble,        PyArray_CDOUBLE)
+TYPEMAP_IN2(const npy_clongdouble,    PyArray_CLONGDOUBLE)
+TYPEMAP_IN2(PyObject,      PyArray_OBJECT)
+
+#undef TYPEMAP_IN2
+
+
+/* TYPEMAP_INPLACE macros
+ *
+ * This family of typemaps allows input/output C arguments of the form
+ *
+ *     (type* INPLACE_ARRAY1, int DIM1)
+ *     (type* INPLACE_ARRAY2, int DIM1, int DIM2)
+ *
+ * where "type" is any type supported by the Numeric module, to be
+ * called in python with an argument list of a single contiguous
+ * Numeric array.  This can be applied to an existing function using
+ * the %apply directive:
+ *
+ *     %apply (double* INPLACE_ARRAY1, int DIM1) {double* series, int length}
+ *     %apply (double* INPLACE_ARRAY2, int DIM1, int DIM2) {double* mx, int rows, int cols}
+ *     void negate(double* series, int length);
+ *     void normalize(double* mx, int rows, int cols);
+ *     
+ *
+ * or with
+ *
+ *     void sum(double* INPLACE_ARRAY1, int DIM1);
+ *     void sum(double* INPLACE_ARRAY2, int DIM1, int DIM2);
+ */
+
+ /* One dimensional input/output arrays */
+%define TYPEMAP_INPLACE1(type,typecode)
+%typemap(in) (type* INPLACE_ARRAY) (PyArrayObject* temp=NULL) {
+  int i;
+  temp = obj_to_array_no_conversion($input,typecode);
+  if (!temp  || !require_contiguous(temp)) SWIG_fail;
+  $1 = (type*) temp->data;
+}
+%enddef
+
+/* Define concrete examples of the TYPEMAP_INPLACE1 macro */
+TYPEMAP_INPLACE1(char,          PyArray_CHAR  )
+TYPEMAP_INPLACE1(unsigned char, PyArray_UBYTE )
+TYPEMAP_INPLACE1(signed char,   PyArray_SBYTE )
+TYPEMAP_INPLACE1(short,         PyArray_SHORT )
+TYPEMAP_INPLACE1(int,           PyArray_INT   )
+TYPEMAP_INPLACE1(long,          PyArray_LONG  )
+TYPEMAP_INPLACE1(float,         PyArray_FLOAT )
+TYPEMAP_INPLACE1(double,        PyArray_DOUBLE)
+TYPEMAP_INPLACE1(long double,        PyArray_LONGDOUBLE)
+TYPEMAP_INPLACE1(npy_cfloat,         PyArray_CFLOAT )
+TYPEMAP_INPLACE1(npy_cdouble,        PyArray_CDOUBLE)
+TYPEMAP_INPLACE1(npy_clongdouble,    PyArray_CLONGDOUBLE)
+TYPEMAP_INPLACE1(const char,          PyArray_CHAR  )
+TYPEMAP_INPLACE1(const unsigned char, PyArray_UBYTE )
+TYPEMAP_INPLACE1(const signed char,   PyArray_SBYTE )
+TYPEMAP_INPLACE1(const short,         PyArray_SHORT )
+TYPEMAP_INPLACE1(const int,           PyArray_INT   )
+TYPEMAP_INPLACE1(const long,          PyArray_LONG  )
+TYPEMAP_INPLACE1(const float,         PyArray_FLOAT )
+TYPEMAP_INPLACE1(const double,        PyArray_DOUBLE)
+TYPEMAP_INPLACE1(const long double,        PyArray_LONGDOUBLE)
+TYPEMAP_INPLACE1(const npy_cfloat,         PyArray_CFLOAT )
+TYPEMAP_INPLACE1(const npy_cdouble,        PyArray_CDOUBLE)
+TYPEMAP_INPLACE1(const npy_clongdouble,    PyArray_CLONGDOUBLE)
+TYPEMAP_INPLACE1(PyObject,      PyArray_OBJECT)
+
+#undef TYPEMAP_INPLACE1
+
+
+
+
+
+ /* Two dimensional input/output arrays */
+%define TYPEMAP_INPLACE2(type,typecode)
+  %typemap(in) (type* INPLACE_ARRAY2) (PyArrayObject* temp=NULL) {
+  temp = obj_to_array_no_conversion($input,typecode);
+  if (!temp || !require_contiguous(temp)) SWIG_fail;
+  $1 = (type*) temp->data;
+}
+%enddef
+
+/* Define concrete examples of the TYPEMAP_INPLACE2 macro */
+TYPEMAP_INPLACE2(char,          PyArray_CHAR  )
+TYPEMAP_INPLACE2(unsigned char, PyArray_UBYTE )
+TYPEMAP_INPLACE2(signed char,   PyArray_SBYTE )
+TYPEMAP_INPLACE2(short,         PyArray_SHORT )
+TYPEMAP_INPLACE2(int,           PyArray_INT   )
+TYPEMAP_INPLACE2(long,          PyArray_LONG  )
+TYPEMAP_INPLACE2(float,         PyArray_FLOAT )
+TYPEMAP_INPLACE2(double,        PyArray_DOUBLE)
+TYPEMAP_INPLACE2(long double,        PyArray_LONGDOUBLE)
+TYPEMAP_INPLACE2(npy_cfloat,         PyArray_CFLOAT )
+TYPEMAP_INPLACE2(npy_cdouble,        PyArray_CDOUBLE)
+TYPEMAP_INPLACE2(npy_clongdouble,    PyArray_CLONGDOUBLE)
+TYPEMAP_INPLACE2(const char,          PyArray_CHAR  )
+TYPEMAP_INPLACE2(const unsigned char, PyArray_UBYTE )
+TYPEMAP_INPLACE2(const signed char,   PyArray_SBYTE )
+TYPEMAP_INPLACE2(const short,         PyArray_SHORT )
+TYPEMAP_INPLACE2(const int,           PyArray_INT   )
+TYPEMAP_INPLACE2(const long,          PyArray_LONG  )
+TYPEMAP_INPLACE2(const float,         PyArray_FLOAT )
+TYPEMAP_INPLACE2(const double,        PyArray_DOUBLE)
+TYPEMAP_INPLACE2(const long double,        PyArray_LONGDOUBLE)
+TYPEMAP_INPLACE2(const npy_cfloat,         PyArray_CFLOAT )
+TYPEMAP_INPLACE2(const npy_cdouble,        PyArray_CDOUBLE)
+TYPEMAP_INPLACE2(const npy_clongdouble,    PyArray_CLONGDOUBLE)
+TYPEMAP_INPLACE2(PyObject,      PyArray_OBJECT)
+
+#undef TYPEMAP_INPLACE2
+
+
+
+
+/* TYPEMAP_ARGOUT macros
+ *
+ * This family of typemaps allows output C arguments of the form
+ *
+ *     (type* ARGOUT_ARRAY[ANY])
+ *     (type* ARGOUT_ARRAY[ANY][ANY])
+ *
+ * where "type" is any type supported by the Numeric module, to be
+ * called in python with an argument list of a single contiguous
+ * Numeric array.  This can be applied to an existing function using
+ * the %apply directive:
+ *
+ *     %apply (double* ARGOUT_ARRAY[ANY] {double series, int length}
+ *     %apply (double* ARGOUT_ARRAY[ANY][ANY]) {double* mx, int rows, int cols}
+ *     void negate(double* series, int length);
+ *     void normalize(double* mx, int rows, int cols);
+ *     
+ *
+ * or with
+ *
+ *     void sum(double* ARGOUT_ARRAY[ANY]);
+ *     void sum(double* ARGOUT_ARRAY[ANY][ANY]);
+ */
+
+ /* One dimensional input/output arrays */
+%define TYPEMAP_ARGOUT1(type,typecode)
+%typemap(in,numinputs=0) type ARGOUT_ARRAY[ANY] {
+  $1 = (type*) malloc($1_dim0*sizeof(type));
+  if (!$1) {
+    PyErr_SetString(PyExc_RuntimeError, "Failed to allocate memory");
+    SWIG_fail;
+  }
+}
+%typemap(argout) ARGOUT_ARRAY[ANY] {
+  int dimensions[1] = {$1_dim0};
+  PyObject* outArray = PyArray_FromDimsAndData(1, dimensions, typecode, (char*)$1);
+}
+%enddef
+
+/* Define concrete examples of the TYPEMAP_ARGOUT1 macro */
+TYPEMAP_ARGOUT1(char,          PyArray_CHAR  )
+TYPEMAP_ARGOUT1(unsigned char, PyArray_UBYTE )
+TYPEMAP_ARGOUT1(signed char,   PyArray_SBYTE )
+TYPEMAP_ARGOUT1(short,         PyArray_SHORT )
+TYPEMAP_ARGOUT1(int,           PyArray_INT   )
+TYPEMAP_ARGOUT1(long,          PyArray_LONG  )
+TYPEMAP_ARGOUT1(float,         PyArray_FLOAT )
+TYPEMAP_ARGOUT1(double,        PyArray_DOUBLE)
+TYPEMAP_ARGOUT1(long double,        PyArray_LONGDOUBLE)
+TYPEMAP_ARGOUT1(npy_cfloat,         PyArray_CFLOAT )
+TYPEMAP_ARGOUT1(npy_cdouble,        PyArray_CDOUBLE)
+TYPEMAP_ARGOUT1(npy_clongdouble,    PyArray_CLONGDOUBLE)
+TYPEMAP_ARGOUT1(PyObject,      PyArray_OBJECT)
+
+#undef TYPEMAP_ARGOUT1
+
+ /* Two dimensional input/output arrays */
+%define TYPEMAP_ARGOUT2(type,typecode)
+  %typemap(in) (type* ARGOUT_ARRAY2, int DIM1, int DIM2) (PyArrayObject* temp=NULL) {
+  temp = obj_to_array_no_conversion($input,typecode);
+  if (!temp || !require_contiguous(temp)) SWIG_fail;
+  $1 = (type*) temp->data;
+  $2 = temp->dimensions[0];
+  $3 = temp->dimensions[1];
+}
+%enddef
+
+/* Define concrete examples of the TYPEMAP_ARGOUT2 macro */
+TYPEMAP_ARGOUT2(char,          PyArray_CHAR  )
+TYPEMAP_ARGOUT2(unsigned char, PyArray_UBYTE )
+TYPEMAP_ARGOUT2(signed char,   PyArray_SBYTE )
+TYPEMAP_ARGOUT2(short,         PyArray_SHORT )
+TYPEMAP_ARGOUT2(int,           PyArray_INT   )
+TYPEMAP_ARGOUT2(long,          PyArray_LONG  )
+TYPEMAP_ARGOUT2(float,         PyArray_FLOAT )
+TYPEMAP_ARGOUT2(double,        PyArray_DOUBLE)
+TYPEMAP_ARGOUT2(long double,        PyArray_LONGDOUBLE)
+TYPEMAP_ARGOUT2(npy_cfloat,         PyArray_CFLOAT )
+TYPEMAP_ARGOUT2(npy_cdouble,        PyArray_CDOUBLE)
+TYPEMAP_ARGOUT2(npy_clongdouble,    PyArray_CLONGDOUBLE)
+TYPEMAP_ARGOUT2(PyObject,      PyArray_OBJECT)
+
+#undef TYPEMAP_ARGOUT2

Added: trunk/Lib/sparse/sparsetools/sparsetools.h
===================================================================
--- trunk/Lib/sparse/sparsetools/sparsetools.h	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/sparsetools/sparsetools.h	2007-01-06 06:34:41 UTC (rev 2496)
@@ -0,0 +1,863 @@
+#ifndef SPARSETOOLS_H
+#define SPARSETOOLS_H
+
+
+/*
+ * sparsetools.h 
+ *   A collection of CSR/CSC/COO matrix conversion and arithmetic functions.
+ *  
+ * Authors:  
+ *    Nathan Bell
+ *
+ * Revisions:
+ *    01/06/2007 - initial inclusion into SciPy
+ *
+ */
+
+
+
+
+#include <vector>
+
+
+
+
+
+/*
+ * Return zero of the appropriate type
+ */
+template <class T> 
+T ZERO(){
+  T temp = {0};
+  return temp;
+}
+
+
+
+/*
+ * Compute B = A for CSR matrix A, CSC matrix B
+ *
+ * Also, with the appropriate arguments can also be used to:
+ *   - compute B = A^t for CSR matrix A, CSR matrix B
+ *   - compute B = A^t for CSC matrix A, CSC matrix B
+ *   - convert CSC->CSR
+ *
+ * Input Arguments:
+ *   int  n_row         - number of rows in A
+ *   int  n_col         - number of columns in A
+ *   int  Ap[n_row+1]   - row pointer
+ *   int  Aj[nnz(A)]    - column indices
+ *   T    Ax[nnz(A)]    - nonzeros
+ *
+ * Output Arguments:
+ *   vec<int> Bp  - row pointer
+ *   vec<int> Bj  - column indices
+ *   vec<T>   Bx  - nonzeros
+ *
+ * Note:
+ *   Output arrays Bp,Bj,Bx will be allocated within in the method
+ *
+ * Note: 
+ *   Input:  column indices *are not* assumed to be in sorted order
+ *   Output: row indices *will be* in sorted order
+ *
+ *   Complexity: Linear.  Specifically O(nnz(A) + max(n_row,n_col))
+ * 
+ */
+template <class T>
+void csrtocsc(const int n_row,
+	      const int n_col, 
+	      const int Ap[], 
+	      const int Aj[], 
+	      const T   Ax[],
+	      std::vector<int>* Bp,
+	      std::vector<int>* Bi,
+	      std::vector<T>*   Bx)
+{  
+  int NNZ = Ap[n_row];
+  
+  *Bp = std::vector<int>(n_col+1);
+  *Bi = std::vector<int>(NNZ);
+  *Bx = std::vector<T>(NNZ);
+ 
+  std::vector<int> nnz_per_col(n_col,0); //temp array
+ 
+  //compute number of non-zero entries per column of A 
+  for (int i = 0; i < NNZ; i++){            
+    nnz_per_col[Aj[i]]++;
+  }
+        
+  //cumsum the nnz_per_col to get Bp[]
+  for(int i = 0, cumsum = 0; i < n_col; i++){     
+    (*Bp)[i]   = cumsum; 
+    cumsum += nnz_per_col[i];
+    nnz_per_col[i] = 0;              //reset count
+  }
+  (*Bp)[n_col] = NNZ;
+  
+  for(int i = 0; i < n_row; i++){
+    int row_start = Ap[i];
+    int row_end   = Ap[i+1];
+    for(int j = row_start; j < row_end; j++){
+      int col = Aj[j];
+      int k   = (*Bp)[col] + nnz_per_col[col];
+
+      (*Bi)[k] = i;
+      (*Bx)[k] = Ax[j];
+
+      nnz_per_col[col]++;
+    }
+  }  
+}   
+
+
+
+
+/*
+ * Compute B = A for CSR matrix A, COO matrix B
+ *
+ * Also, with the appropriate arguments can also be used to:
+ *   - convert CSC->COO
+ *
+ * Input Arguments:
+ *   int  n_row         - number of rows in A
+ *   int  n_col         - number of columns in A
+ *   int  Ap[n_row+1]   - row pointer
+ *   int  Aj[nnz(A)]    - column indices
+ *   T    Ax[nnz(A)]    - nonzeros
+ *
+ * Output Arguments:
+ *   vec<int> Bi  - row indices
+ *   vec<int> Bj  - column indices
+ *   vec<T>   Bx  - nonzeros
+ *
+ * Note:
+ *   Output arrays Bi,Bj,Bx will be allocated within in the method
+ *
+ * Note: 
+ *   Complexity: Linear.
+ * 
+ */
+template<class T>
+void csrtocoo(const int n_row,
+	      const int n_col, 
+	      const int Ap [], 
+	      const int Aj[], 
+	      const T   Ax[],
+	      std::vector<int>*    Bi,
+	      std::vector<int>*    Bj,
+	      std::vector<T>* Bx)
+{
+  for(int i = 0; i < n_row; i++){
+    int row_start = Ap[i];
+    int row_end   = Ap[i+1];
+    for(int jj = row_start; jj < row_end; jj++){
+      Bi->push_back(i);
+      Bj->push_back(Aj[jj]);
+      Bx->push_back(Ax[jj]);
+    }
+  }
+}
+
+
+
+/*
+ * Compute C = A*B for CSR matrices A,B
+ *
+ *
+ * Input Arguments:
+ *   int  n_row       - number of rows in A
+ *   int  n_col       - number of columns in B (hence C is n_row by n_col)
+ *   int  Ap[n_row+1] - row pointer
+ *   int  Aj[nnz(A)]  - column indices
+ *   T    Ax[nnz(A)]  - nonzeros
+ *   int  Bp[?]       - row pointer
+ *   int  Bj[nnz(B)]  - column indices
+ *   T    Bx[nnz(B)]  - nonzeros
+ * Output Arguments:
+ *   vec<int> Cp - row pointer
+ *   vec<int> Cj - column indices
+ *   vec<T>   Cx - nonzeros
+ *   
+ * Note:
+ *   Output arrays Cp,Cj, and Cx will be allocated within in the method
+ *
+ * Note: 
+ *   Input:  A and B column indices *are not* assumed to be in sorted order 
+ *   Output: C column indices *are not* assumed to be in sorted order
+ *           Cx will not contain any zero entries
+ *
+ *   Complexity: O(n_row*K^2 + max(n_row,n_col)) 
+ *                 where K is the maximum nnz in a row of A
+ *                 and column of B.
+ *
+ *
+ *  This implementation closely follows the SMMP algorithm:
+ *
+ *    "Sparse Matrix Multiplication Package (SMMP)"
+ *      Randolph E. Bank and Craig C. Douglas
+ *
+ *    http://citeseer.ist.psu.edu/445062.html
+ *    http://www.mgnet.org/~douglas/ccd-codes.html
+ *
+ */
+template<class T>
+void csrmucsr(const int n_row,
+	      const int n_col, 
+	      const int Ap [], 
+	      const int Aj[], 
+	      const T Ax[],
+	      const int Bp[],
+	      const int Bj[],
+	      const T Bx[],
+	      std::vector<int>* Cp,
+	      std::vector<int>* Cj,
+	      std::vector<T>* Cx)
+{
+  *Cp = std::vector<int>(n_row+1,0);
+  Cj->clear();        
+  Cx->clear();
+  
+  const T zero = ZERO<T>();
+
+  std::vector<int>    index(n_col,-1);
+  std::vector<T> sums(n_col,zero);
+
+  for(int i = 0; i < n_row; i++){
+    int istart = -1;
+    int length =  0;
+    
+    for(int jj = Ap[i]; jj < Ap[i+1]; jj++){
+      int j = Aj[jj];
+      for(int kk = Bp[j]; kk < Bp[j+1]; kk++){
+	int k = Bj[kk];
+        
+	sums[k] += Ax[jj]*Bx[kk];
+        
+	if(index[k] == -1){
+	  index[k] = istart;                        
+	  istart = k;
+	  length++;
+	}
+      }
+    }         
+
+    for(int jj = 0; jj < length; jj++){
+      if(sums[istart] != zero){
+	Cj->push_back(istart);
+	Cx->push_back(sums[istart]);
+      }
+	
+      int temp = istart;                
+      istart = index[istart];
+      
+      index[temp] = -1; //clear arrays
+      sums[temp]  = zero;                              
+    }
+    
+    (*Cp)[i+1] = Cx->size();
+  }
+}
+
+
+
+
+/*
+ * Compute C = A+B for CSR matrices A,B
+ *
+ *
+ * Input Arguments:
+ *   int    n_row       - number of rows in A (and B)
+ *   int    n_col       - number of columns in A (and B)
+ *   int    Ap[n_row+1] - row pointer
+ *   int    Aj[nnz(A)]  - column indices
+ *   T      Ax[nnz(A)]  - nonzeros
+ *   int    Bp[?]       - row pointer
+ *   int    Bj[nnz(B)]  - column indices
+ *   T      Bx[nnz(B)]  - nonzeros
+ * Output Arguments:
+ *   vec<int> Cp  - row pointer
+ *   vec<int> Cj  - column indices
+ *   vec<T>   Cx  - nonzeros
+ *   
+ * Note:
+ *   Output arrays Cp,Cj, and Cx will be allocated within in the method
+ *
+ * Note: 
+ *   Input:  A and B column indices *are not* assumed to be in sorted order 
+ *   Output: C column indices *are not* assumed to be in sorted order
+ *           Cx will not contain any zero entries
+ *
+ */
+template <class T>
+void csrplcsr(const int n_row,
+	      const int n_col, 
+	      const int Ap[], 
+	      const int Aj[], 
+	      const T   Ax[],
+	      const int Bp[],
+	      const int Bj[],
+	      const T   Bx[],
+	      std::vector<int>* Cp,
+	      std::vector<int>* Cj,
+	      std::vector<T>  * Cx)
+{
+
+  *Cp = std::vector<int>(n_row+1,0);
+  Cj->clear();        
+  Cx->clear();
+  
+  const T zero = ZERO<T>();
+
+  std::vector<int> index(n_col,-1);
+  std::vector<T>   sums(n_col,zero);
+
+  for(int i = 0; i < n_row; i++){
+    int istart = -1;
+    int length =  0;
+    
+    //add a row of A to sums
+    for(int jj = Ap[i]; jj < Ap[i+1]; jj++){
+      int j = Aj[jj];
+      sums[j] += Ax[jj];
+              
+      if(index[j] == -1){
+	index[j] = istart;                        
+	istart = j;
+	length++;
+      }
+    }
+    
+    //add a row of B to sums
+    for(int jj = Bp[i]; jj < Bp[i+1]; jj++){
+      int j = Bj[jj];
+      sums[j] += Bx[jj];
+
+      if(index[j] == -1){
+	index[j] = istart;                        
+	istart = j;
+	length++;
+      }
+    }
+
+
+    for(int jj = 0; jj < length; jj++){
+      if(sums[istart] != zero){
+	Cj->push_back(istart);
+	Cx->push_back(sums[istart]);
+      }
+      
+      int temp = istart;                
+      istart = index[istart];
+      
+      index[temp] = -1;
+      sums[temp]  = zero;                              
+    }
+    
+    (*Cp)[i+1] = Cx->size();
+  }
+}
+
+/*
+ * Compute C = A (elmul) B for CSR matrices A,B
+ *
+ *   (elmul) - elementwise multiplication
+ *
+ * Input Arguments:
+ *   int    n_row       - number of rows in A (and B)
+ *   int    n_col       - number of columns in A (and B)
+ *   int    Ap[n_row+1] - row pointer
+ *   int    Aj[nnz(A)]  - column indices
+ *   T      Ax[nnz(A)]  - nonzeros
+ *   int    Bp[?]       - row pointer
+ *   int    Bj[nnz(B)]  - column indices
+ *   T      Bx[nnz(B)]  - nonzeros
+ * Output Arguments:
+ *   vec<int> Cp  - row pointer
+ *   vec<int> Cj  - column indices
+ *   vec<T>   Cx  - nonzeros
+ *   
+ * Note:
+ *   Output arrays Cp,Cj, and Cx will be allocated within in the method
+ *
+ * Note: 
+ *   Input:  A and B column indices *are not* assumed to be in sorted order 
+ *   Output: C column indices *are not* assumed to be in sorted order
+ *           Cx will not contain any zero entries
+ *
+ */
+template <class T>
+void csrelmulcsr(const int n_row,
+		 const int n_col, 
+		 const int Ap [], 
+		 const int Aj[], 
+		 const T   Ax[],
+		 const int Bp[],
+		 const int Bj[],
+		 const T   Bx[],
+		 std::vector<int>* Cp,
+		 std::vector<int>* Cj,
+		 std::vector<T>*   Cx)
+{
+  *Cp = std::vector<int>(n_row+1,0);
+  Cj->clear();        
+  Cx->clear();
+  
+  const T zero = ZERO<T>();
+
+  std::vector<int>   index(n_col,-1);
+  std::vector<T> A_row(n_col,zero);
+  std::vector<T> B_row(n_col,zero);
+
+  for(int i = 0; i < n_row; i++){
+    int istart = -1;
+    int length =  0;
+    
+    //add a row of A to A_row
+    for(int jj = Ap[i]; jj < Ap[i+1]; jj++){
+      int j = Aj[jj];
+
+      A_row[j] += Ax[jj];
+      
+      if(index[j] == -1){
+	index[j] = istart;                        
+	istart = j;
+	length++;
+      }
+    }
+    
+    //add a row of B to B_row
+    for(int jj = Bp[i]; jj < Bp[i+1]; jj++){
+      int j = Bj[jj];
+
+      B_row[j] += Bx[jj];
+
+      if(index[j] == -1){
+	index[j] = istart;                        
+	istart = j;
+	length++;
+      }
+    }
+
+
+    for(int jj = 0; jj < length; jj++){
+      T prod = A_row[istart] * B_row[istart];
+      
+      if(prod != zero){
+	Cj->push_back(istart);
+	Cx->push_back(prod);
+      }
+      
+      int temp = istart;                
+      istart = index[istart];
+      
+      index[temp] = -1;
+      A_row[temp] = zero;                              
+      B_row[temp] = zero;
+    }
+    
+    (*Cp)[i+1] = Cx->size();
+  }
+}
+
+
+/*
+ * Compute B = A for COO matrix A, CSR matrix B
+ *
+ *
+ * Input Arguments:
+ *   int  n_row         - number of rows in A
+ *   int  n_col         - number of columns in A
+ *   int  Ai[nnz(A)]    - row indices
+ *   int  Aj[nnz(A)]    - column indices
+ *   T    Ax[nnz(A)]    - nonzeros
+ * Output Arguments:
+ *   vec<int> Bp        - row pointer
+ *   vec<int> Bj        - column indices
+ *   vec<T>   Bx        - nonzeros
+ *
+ * Note:
+ *   Output arrays Bp,Bj,Bx will be allocated within in the method
+ *
+ * Note: 
+ *   Input:  row and column indices *are not* assumed to be ordered
+ *           duplicate (i,j) entries will be summed together
+ *
+ *   Output: CSR column indices *will be* in sorted order
+ *
+ *   Complexity: Linear.  Specifically O(nnz(A) + max(n_row,n_col))
+ * 
+ */
+template<class T>
+void cootocsr(const int n_row,
+	      const int n_col,
+	      const int NNZ,
+	      const int Ai[],
+	      const int Aj[],
+	      const T   Ax[],
+	      std::vector<int>* Bp,
+	      std::vector<int>* Bj,
+	      std::vector<T>* Bx)
+{
+  std::vector<int> tempBp(n_row+1,0);
+  std::vector<int> tempBj(NNZ);
+  std::vector<T>   tempBx(NNZ);
+
+  std::vector<int> nnz_per_row(n_row,0); //temp array
+
+  //compute nnz per row, then compute Bp
+  for(int i = 0; i < NNZ; i++){
+    nnz_per_row[Ai[i]]++;
+  }
+  for(int i = 0, cumsum = 0; i < n_row; i++){
+    tempBp[i]      = cumsum;
+    cumsum        += nnz_per_row[i];
+    nnz_per_row[i] = 0; //reset count
+  }
+  tempBp[n_row] = NNZ;
+
+
+  //write Aj,Ax into tempBj,tempBx
+  for(int i = 0; i < NNZ; i++){
+    int row = Ai[i];
+    int n   = tempBp[row] + nnz_per_row[row];
+
+    tempBj[n] = Aj[i];
+    tempBx[n] = Ax[i];
+
+    nnz_per_row[row]++;
+  }
+  //now tempBp,tempBj,tempBx form a CSR representation (with duplicates)
+
+
+  //use (tempB + 0) to sum duplicates
+  std::vector<int> Xp(n_row+1,0); //row pointer for an empty matrix
+
+  csrplcsr<T>(n_row,n_col,
+	      &tempBp[0],&tempBj[0],&tempBx[0],
+	      &Xp[0],NULL,NULL,
+	      Bp,Bj,Bx);    	   
+}
+	    
+
+
+
+
+/*
+ * Compute Y = A*X for CSR matrix A and dense vectors X,Y
+ *
+ *
+ * Input Arguments:
+ *   int  n_row         - number of rows in A
+ *   int  n_col         - number of columns in A
+ *   int  Ap[n_row+1]   - row pointer
+ *   int  Aj[nnz(A)]    - column indices
+ *   T    Ax[n_col]     - nonzeros
+ *   T    Xx[n_col]     - nonzeros
+ *
+ * Output Arguments:
+ *   vec<T> Yx - nonzeros (real part)
+ *
+ * Note:
+ *   Output array Xx will be allocated within in the method
+ *
+ *   Complexity: Linear.  Specifically O(nnz(A) + max(n_row,n_col))
+ * 
+ */
+template <class T>
+void csrmux(const int n_row,
+	    const int n_col, 
+	    const int Ap [], 
+	    const int Aj[], 
+	    const T   Ax[],
+	    const T   Xx[],
+	    std::vector<T>*  Yx)
+{
+  const T zero = ZERO<T>();
+
+  *Yx = std::vector<T>(n_row,zero);
+
+  for(int i = 0; i < n_row; i++){
+    int row_start = Ap[i];
+    int row_end   = Ap[i+1];
+    
+    T& Yx_i = (*Yx)[i];
+    for(int jj = row_start; jj < row_end; jj++){
+      Yx_i += Ax[jj] * Xx[Aj[jj]];
+    }
+  }
+}
+
+
+
+/*
+ * Compute Y = A*X for CSC matrix A and dense vectors X,Y
+ *
+ *
+ * Input Arguments:
+ *   int  n_row         - number of rows in A
+ *   int  n_col         - number of columns in A
+ *   int  Ap[n_row+1]   - column pointer
+ *   int  Ai[nnz(A)]    - row indices
+ *   T    Ax[n_col]     - nonzeros (real part)
+ *   T    Xx[n_col]     - nonzeros (real part)
+ *   bool do_complex    - switch scalar/complex modes
+ *
+ * Output Arguments:
+ *   vec<T> Yx - nonzeros (real part)
+ *
+ * Note:
+ *   Output arrays Xx will be allocated within in the method
+ *
+ *   Complexity: Linear.  Specifically O(nnz(A) + max(n_row,n_col))
+ * 
+ */
+template <class T>
+void cscmux(const int n_row,
+	    const int n_col, 
+	    const int Ap[], 
+	    const int Ai[], 
+	    const T   Ax[],
+	    const T   Xx[],
+	    std::vector<T>*  Yx)
+{
+  const T zero = ZERO<T>();
+
+  *Yx = std::vector<T>(n_row,zero);
+  
+  for(int j = 0; j < n_col; j++){
+    int col_start = Ap[j];
+    int col_end   = Ap[j+1];
+    
+    for(int ii = col_start; ii < col_end; ii++){
+      int row  = Ai[ii];
+      (*Yx)[row] += Ax[ii] * Xx[j];
+    }
+  }
+}
+
+
+
+
+/*
+ * Construct CSC matrix A from diagonals
+ *
+ * Input Arguments:
+ *   int  n_row                            - number of rows in A
+ *   int  n_col                            - number of columns in A
+ *   int  n_diags                          - number of diagonals
+ *   int  diags_indx[n_diags]              - where to place each diagonal 
+ *   T    diags[n_diags][min(n_row,n_col)] - diagonals
+ *
+ * Output Arguments:
+ *   vec<int> Ap  - row pointer
+ *   vec<int> Aj  - column indices
+ *   vec<T>   Ax  - nonzeros
+ *
+ * Note:
+ *   Output arrays Ap,Aj,Ax will be allocated within in the method
+ *
+ * Note: 
+ *   Output: row indices are not in sorted order
+ *
+ *   Complexity: Linear
+ * 
+ */
+template<class T>
+void spdiags(const int n_row,
+	     const int n_col,
+	     const int n_diag,
+	     const int offsets[],
+	     const T   diags[],
+	     std::vector<int> * Ap,
+	     std::vector<int> * Ai,
+	     std::vector<T>   * Ax)
+{
+  const int diags_length = std::min(n_row,n_col);
+  Ap->push_back(0);
+
+  for(int i = 0; i < n_col; i++){
+    for(int j = 0; j < n_diag; j++){
+      if(offsets[j] <= 0){              //sub-diagonal
+	int row = i - offsets[j];
+	if (row >= n_row){ continue; }
+	
+	Ai->push_back(row);
+	Ax->push_back(diags[j*diags_length + i]);
+
+      } else {                          //super-diagonal
+	int row = i - offsets[j];
+	if (row < 0 || row >= n_row){ continue; }
+
+	Ai->push_back(row);
+	Ax->push_back(diags[j*diags_length + row]);
+      }
+    }
+    Ap->push_back(Ai->size());
+  }
+}
+
+
+
+/*
+ * Compute M = A for CSR matrix A, dense matrix M
+ *
+ * Input Arguments:
+ *   int  n_row           - number of rows in A
+ *   int  n_col           - number of columns in A
+ *   int  Ap[n_row+1]     - row pointer
+ *   int  Aj[nnz(A)]      - column indices
+ *   T    Ax[nnz(A)]      - nonzeros 
+ *   T    Mx[n_row*n_col] - dense matrix
+ *
+ * Note:
+ *   Output arrays Mx are assumed to be allocated and
+ *   initialized to 0 by the caller.
+ *
+ */
+template<class T>
+void csrtodense(const int  n_row,
+		const int  n_col,
+		const int  Ap[],
+		const int  Aj[],
+		const T    Ax[],
+		      T    Mx[])
+{
+  int row_base = 0;
+  for(int i = 0; i < n_row; i++){
+    int row_start = Ap[i];
+    int row_end   = Ap[i+1];
+    for(int jj = row_start; jj < row_end; jj++){
+      int j = Aj[jj];
+
+      Mx[row_base + j] = Ax[jj];
+    }	
+    row_base +=  n_col;
+  }
+}
+
+
+
+/*
+ * Compute A = M for CSR matrix A, dense matrix M
+ *
+ * Input Arguments:
+ *   int  n_row           - number of rows in A
+ *   int  n_col           - number of columns in A
+ *   T    Mx[n_row*n_col] - dense matrix
+ *   int  Ap[n_row+1]     - row pointer
+ *   int  Aj[nnz(A)]      - column indices
+ *   T    Ax[nnz(A)]      - nonzeros 
+ *
+ * Note:
+ *    Output arrays Ap,Aj,Ax will be allocated within the method
+ *
+ */
+template<class T>
+void densetocsr(const int  n_row,
+		const int  n_col,
+		const T    Mx[],
+		std::vector<int>* Ap,
+		std::vector<int>* Aj,
+		std::vector<T>*   Ax)
+{
+  const T zero = ZERO<T>();
+  const T* x_ptr = Mx;
+
+  Ap->push_back(0);
+  for(int i = 0; i < n_row; i++){
+    for(int j = 0; j < n_col; j++){
+      if(*x_ptr != zero){
+	Aj->push_back(j);
+	Ax->push_back(*x_ptr);
+      }
+      x_ptr++;
+    }
+    Ap->push_back(Aj->size());
+  }
+}
+
+
+
+/*
+ * Derived methods
+ */
+template <class T>
+void csctocsr(const int n_row,
+	      const int n_col, 
+	      const int Ap[], 
+	      const int Ai[], 
+	      const T   Ax[],
+	      std::vector<int>* Bp,
+	      std::vector<int>* Bj,
+	      std::vector<T>*   Bx)
+{ csrtocsc<T>(n_col,n_row,Ap,Ai,Ax,Bp,Bj,Bx); }
+
+template<class T>
+void csctocoo(const int n_row,
+	      const int n_col, 
+	      const int Ap[], 
+	      const int Ai[], 
+	      const T   Ax[],
+	      std::vector<int>*    Bi,
+	      std::vector<int>*    Bj,
+	      std::vector<T>*      Bx)
+{ csrtocoo<T>(n_col,n_row,Ap,Ai,Ax,Bj,Bi,Bx); }
+
+template<class T>
+void cscmucsc(const int n_row,
+	      const int n_col, 
+	      const int Ap [], 
+	      const int Ai[], 
+	      const T   Ax[],
+	      const int Bp[],
+	      const int Bi[],
+	      const T   Bx[],
+	      std::vector<int>* Cp,
+	      std::vector<int>* Ci,
+	      std::vector<T>  * Cx)
+{ csrmucsr<T>(n_col,n_row,Bp,Bi,Bx,Ap,Ai,Ax,Cp,Ci,Cx); }
+
+template <class T>
+void cscplcsc(const int n_row,
+	      const int n_col, 
+	      const int Ap [], 
+	      const int Ai[], 
+	      const T   Ax[],
+	      const int Bp[],
+	      const int Bi[],
+	      const T   Bx[],
+	      std::vector<int>* Cp,
+	      std::vector<int>* Ci,
+	      std::vector<T>*   Cx)
+{ csrplcsr<T>(n_col,n_row,Ap,Ai,Ax,Bp,Bi,Bx,Cp,Ci,Cx); }
+
+template <class T>
+void cscelmulcsc(const int n_row,
+		 const int n_col, 
+		 const int Ap [], 
+		 const int Ai[], 
+		 const T   Ax[],
+		 const int Bp[],
+		 const int Bi[],
+		 const T   Bx[],
+		 std::vector<int>* Cp,
+		 std::vector<int>* Ci,
+		 std::vector<T>*   Cx)
+{ csrelmulcsr<T>(n_col,n_row,Ap,Ai,Ax,Bp,Bi,Bx,Cp,Ci,Cx); }
+
+template<class T>
+void cootocsc(const int n_row,
+	      const int n_col,
+	      const int NNZ,
+	      const int Ai[],
+	      const int Aj[],
+	      const T   Ax[],
+	      std::vector<int>* Bp,
+	      std::vector<int>* Bi,
+	      std::vector<T>*   Bx)
+{ cootocsr<T>(n_col,n_row,NNZ,Aj,Ai,Ax,Bp,Bi,Bx); }
+
+
+
+#endif

Added: trunk/Lib/sparse/sparsetools/sparsetools.i
===================================================================
--- trunk/Lib/sparse/sparsetools/sparsetools.i	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/sparsetools/sparsetools.i	2007-01-06 06:34:41 UTC (rev 2496)
@@ -0,0 +1,440 @@
+/* -*- C -*-  (not really, but good for syntax highlighting) */
+%module sparsetools
+
+ /* why does SWIG complain about int arrays? a typecheck is provided */
+#pragma SWIG nowarn=467
+
+%{
+#define SWIG_FILE_WITH_INIT
+#include "numpy/arrayobject.h"
+#include "complex_ops.h"
+#include "sparsetools.h"
+%}
+
+%feature("autodoc", "1");
+
+%include "numpy.i"
+
+%init %{
+    import_array();
+%}
+
+
+%{
+/*!
+  Appends @a what to @a where. On input, @a where need not to be a tuple, but on
+  return it always is.
+
+  @par Revision history:
+  - 17.02.2005, c
+*/
+PyObject *helper_appendToTuple( PyObject *where, PyObject *what ) {
+  PyObject *o2, *o3;
+
+  if ((!where) || (where == Py_None)) {
+    where = what;
+  } else {
+    if (!PyTuple_Check( where )) {
+      o2 = where;
+      where = PyTuple_New( 1 );
+      PyTuple_SetItem( where, 0, o2 );
+    }
+    o3 = PyTuple_New( 1 );
+    PyTuple_SetItem( o3, 0, what );
+    o2 = where;
+    where = PySequence_Concat( o2, o3 );
+    Py_DECREF( o2 );
+    Py_DECREF( o3 );
+  }
+  return where;
+}
+
+
+
+
+%}
+
+
+
+/*
+ * Use STL vectors for ARGOUTs
+ */
+%define VEC_ARRAY_ARGOUT( ctype, atype  ) 
+%typemap( in, numinputs=0 ) std::vector<ctype>* array_argout( std::vector<ctype>* tmp ) {
+  tmp = new std::vector<ctype>(); 
+  $1 = tmp; 
+}; 
+%typemap( argout ) std::vector<ctype>* array_argout { 
+  int length = ($1)->size(); 
+  PyObject *obj = PyArray_FromDims(1, &length, PyArray_##atype); 
+  memcpy(PyArray_DATA(obj),&((*($1))[0]),sizeof(ctype)*length);	 
+  delete $1; 
+  $result = helper_appendToTuple( $result, (PyObject *)obj ); 
+}; 
+%enddef
+
+
+
+
+%include "typemaps.i"
+
+%typemap(typecheck) int *, const int *, int [], const int []
+{
+  $1 = (is_array($input) && PyArray_CanCastSafely(PyArray_TYPE($input),PyArray_INT)) ? 1 : 0;
+};
+
+%typemap(typecheck) float *, const float *, float [], const float []
+{
+  $1 = (is_array($input) && PyArray_CanCastSafely(PyArray_TYPE($input),PyArray_FLOAT)) ? 1 : 0;
+};
+
+%typemap(typecheck) double *, const double *, double [], const double []
+{
+  $1 = (is_array($input) && PyArray_CanCastSafely(PyArray_TYPE($input),PyArray_DOUBLE)) ? 1 : 0;
+};
+
+%typemap(typecheck) long double *, const long double *, long double [], const long double []
+{
+  $1 = (is_array($input) && PyArray_CanCastSafely(PyArray_TYPE($input),PyArray_LONGDOUBLE)) ? 1 : 0;
+};
+
+%typemap(typecheck) npy_cfloat *, const npy_cfloat *, npy_cfloat [], const npy_cfloat []
+{
+  $1 = (is_array($input) && PyArray_CanCastSafely(PyArray_TYPE($input),PyArray_CFLOAT)) ? 1 : 0;
+};
+
+%typemap(typecheck) npy_cdouble *, const npy_cdouble *, npy_cdouble [], const npy_cdouble []
+{
+  $1 = (is_array($input) && PyArray_CanCastSafely(PyArray_TYPE($input),PyArray_CDOUBLE)) ? 1 : 0;
+};
+
+%typemap(typecheck) npy_clongdouble *, const npy_clongdouble *, npy_clongdouble [], const npy_clongdouble []
+{
+  $1 = (is_array($input) && PyArray_CanCastSafely(PyArray_TYPE($input),PyArray_CLONGDOUBLE)) ? 1 : 0;
+};
+
+
+
+
+
+
+/*
+ * IN types
+ */
+%apply int * IN_ARRAY1 {
+    const int Ap [ ],
+    const int Ai [ ],
+    const int Aj [ ],
+    const int Bp [ ],
+    const int Bi [ ],	
+    const int Bj [ ],
+    const int offsets [ ]
+};
+
+%apply float * IN_ARRAY1 {
+    const float Ax [ ],
+    const float Bx [ ],
+    const float Xx [ ],
+    const float Yx [ ]
+};
+
+%apply double * IN_ARRAY1 {
+    const double Ax [ ],
+    const double Bx [ ],
+    const double Xx [ ],
+    const double Yx [ ]
+};
+
+%apply long double * IN_ARRAY1 {
+    const long double Ax [ ],
+    const long double Bx [ ],
+    const long double Xx [ ],
+    const long double Yx [ ]
+};
+
+%apply npy_cfloat * IN_ARRAY1 {
+    const npy_cfloat Ax [ ],
+    const npy_cfloat Bx [ ],
+    const npy_cfloat Xx [ ],
+    const npy_cfloat Yx [ ]
+};
+
+%apply npy_cdouble * IN_ARRAY1 {
+    const npy_cdouble Ax [ ],
+    const npy_cdouble Bx [ ],
+    const npy_cdouble Xx [ ],
+    const npy_cdouble Yx [ ]
+};
+
+%apply npy_clongdouble * IN_ARRAY1 {
+    const npy_clongdouble Ax [ ],
+    const npy_clongdouble Bx [ ],
+    const npy_clongdouble Xx [ ],
+    const npy_clongdouble Yx [ ]
+};
+
+
+%apply float * IN_ARRAY2 { const float Mx[] }
+%apply double * IN_ARRAY2 { const double Mx[] }
+%apply long double * IN_ARRAY2 { const long double Mx[] }
+%apply npy_cfloat * IN_ARRAY2 { const npy_cfloat Mx[] }
+%apply npy_cdouble * IN_ARRAY2 { const npy_cdouble Mx[] }
+%apply npy_clongdouble * IN_ARRAY2 { const npy_longdouble Mx[] }
+
+
+%apply float * IN_ARRAY2 { const float diags[] }
+%apply double * IN_ARRAY2 { const double diags[] }
+%apply long double * IN_ARRAY2 { const long double diags[] }
+%apply npy_cfloat * IN_ARRAY2 { const npy_cfloat diags[] }
+%apply npy_cdouble * IN_ARRAY2 { const npy_cdouble diags[] }
+%apply npy_clongdouble * IN_ARRAY2 { const npy_longdouble diags[] }
+
+
+
+/*
+ * OUT types
+ */
+VEC_ARRAY_ARGOUT( int, INT )
+%apply std::vector<int>* array_argout {
+    std::vector<int>* Ap,
+    std::vector<int>* Ai,
+    std::vector<int>* Aj,
+    std::vector<int>* Bp,
+    std::vector<int>* Bi,
+    std::vector<int>* Bj,
+    std::vector<int>* Cp,
+    std::vector<int>* Ci,
+    std::vector<int>* Cj
+};
+
+VEC_ARRAY_ARGOUT( float, FLOAT )
+%apply std::vector<float>* array_argout {
+    std::vector<float>* Ax,
+    std::vector<float>* Bx,
+    std::vector<float>* Cx,
+    std::vector<float>* Xx,
+    std::vector<float>* Yx
+};
+
+VEC_ARRAY_ARGOUT( double, DOUBLE )
+%apply std::vector<double>* array_argout {
+    std::vector<double>* Ax,
+    std::vector<double>* Bx,
+    std::vector<double>* Cx,
+    std::vector<double>* Xx,
+    std::vector<double>* Yx
+};
+
+
+VEC_ARRAY_ARGOUT( long double, LONGDOUBLE )
+%apply std::vector<long double>* array_argout {
+    std::vector<long double>* Ax,
+    std::vector<long double>* Bx,
+    std::vector<long double>* Cx,
+    std::vector<long double>* Xx,
+    std::vector<long double>* Yx
+};
+
+VEC_ARRAY_ARGOUT( npy_cfloat, CFLOAT )
+%apply std::vector<npy_cfloat>* array_argout {
+    std::vector<npy_cfloat>* Ax,
+    std::vector<npy_cfloat>* Bx,
+    std::vector<npy_cfloat>* Cx,
+    std::vector<npy_cfloat>* Xx,
+    std::vector<npy_cfloat>* Yx
+};
+
+
+VEC_ARRAY_ARGOUT( npy_cdouble, CDOUBLE )
+%apply std::vector<npy_cdouble>* array_argout {
+    std::vector<npy_cdouble>* Ax,
+    std::vector<npy_cdouble>* Bx,
+    std::vector<npy_cdouble>* Cx,
+    std::vector<npy_cdouble>* Xx,
+    std::vector<npy_cdouble>* Yx
+};
+
+
+VEC_ARRAY_ARGOUT( npy_clongdouble, CLONGDOUBLE )
+%apply std::vector<npy_clongdouble>* array_argout {
+    std::vector<npy_clongdouble>* Ax,
+    std::vector<npy_clongdouble>* Bx,
+    std::vector<npy_clongdouble>* Cx,
+    std::vector<npy_clongdouble>* Xx,
+    std::vector<npy_clongdouble>* Yx
+};
+
+
+
+/*
+ * INOUT types
+ */
+%apply float * INPLACE_ARRAY2 { float Mx [] }
+%apply double * INPLACE_ARRAY2 { double Mx [] }
+%apply long double * INPLACE_ARRAY2 { long double Mx[] }
+%apply npy_cfloat * INPLACE_ARRAY2 { npy_cfloat Mx[] }
+%apply npy_cdouble * INPLACE_ARRAY2 { npy_cdouble Mx[] }
+%apply npy_clongdouble * INPLACE_ARRAY2 { npy_longdouble Mx[] }
+
+
+
+
+
+
+%include "sparsetools.h"
+
+
+
+ /*
+  * Order may be important here, list float before double
+  */
+
+/*
+ *  CSR->CSC or CSC->CSR or CSR = CSR^T or CSC = CSC^T
+ */
+%template(csrtocsc)   csrtocsc<float>; 
+%template(csrtocsc)   csrtocsc<double>; 
+%template(csrtocsc)   csrtocsc<long double>; 
+%template(csrtocsc)   csrtocsc<npy_cfloat>; 
+%template(csrtocsc)   csrtocsc<npy_cdouble>; 
+%template(csrtocsc)   csrtocsc<npy_clongdouble>; 
+
+%template(csctocsr)   csctocsr<float>; 
+%template(csctocsr)   csctocsr<double>; 
+%template(csctocsr)   csctocsr<long double>; 
+%template(csctocsr)   csctocsr<npy_cfloat>; 
+%template(csctocsr)   csctocsr<npy_cdouble>; 
+%template(csctocsr)   csctocsr<npy_clongdouble>; 
+
+
+/*
+ * CSR<->COO and CSC<->COO
+ */
+%template(csrtocoo)   csrtocoo<float>; 
+%template(csrtocoo)   csrtocoo<double>; 
+%template(csrtocoo)   csrtocoo<long double>; 
+%template(csrtocoo)   csrtocoo<npy_cfloat>; 
+%template(csrtocoo)   csrtocoo<npy_cdouble>; 
+%template(csrtocoo)   csrtocoo<npy_clongdouble>; 
+
+%template(cootocsr)   cootocsr<float>; 
+%template(cootocsr)   cootocsr<double>; 
+%template(cootocsr)   cootocsr<long double>; 
+%template(cootocsr)   cootocsr<npy_cfloat>; 
+%template(cootocsr)   cootocsr<npy_cdouble>; 
+%template(cootocsr)   cootocsr<npy_clongdouble>; 
+
+%template(csctocoo)   csctocoo<float>; 
+%template(csctocoo)   csctocoo<double>; 
+%template(csctocoo)   csctocoo<long double>; 
+%template(csctocoo)   csctocoo<npy_cfloat>; 
+%template(csctocoo)   csctocoo<npy_cdouble>; 
+%template(csctocoo)   csctocoo<npy_clongdouble>; 
+
+%template(cootocsc)   cootocsc<float>; 
+%template(cootocsc)   cootocsc<double>; 
+%template(cootocsc)   cootocsc<long double>; 
+%template(cootocsc)   cootocsc<npy_cfloat>; 
+%template(cootocsc)   cootocsc<npy_cdouble>; 
+%template(cootocsc)   cootocsc<npy_clongdouble>; 
+
+
+/*
+ * CSR+CSR and CSC+CSC
+ */
+%template(csrplcsr)   csrplcsr<float>; 
+%template(csrplcsr)   csrplcsr<double>; 
+%template(csrplcsr)   csrplcsr<long double>; 
+%template(csrplcsr)   csrplcsr<npy_cfloat>; 
+%template(csrplcsr)   csrplcsr<npy_cdouble>; 
+%template(csrplcsr)   csrplcsr<npy_clongdouble>; 
+
+%template(cscplcsc)   cscplcsc<float>; 
+%template(cscplcsc)   cscplcsc<double>; 
+%template(cscplcsc)   cscplcsc<long double>; 
+%template(cscplcsc)   cscplcsc<npy_cfloat>; 
+%template(cscplcsc)   cscplcsc<npy_cdouble>; 
+%template(cscplcsc)   cscplcsc<npy_clongdouble>; 
+
+
+
+/*
+ * CSR*CSR and CSC*CSC
+ */
+%template(csrmucsr)   csrmucsr<float>; 
+%template(csrmucsr)   csrmucsr<double>; 
+%template(csrmucsr)   csrmucsr<long double>; 
+%template(csrmucsr)   csrmucsr<npy_cfloat>; 
+%template(csrmucsr)   csrmucsr<npy_cdouble>; 
+%template(csrmucsr)   csrmucsr<npy_clongdouble>; 
+
+%template(cscmucsc)   cscmucsc<float>; 
+%template(cscmucsc)   cscmucsc<double>; 
+%template(cscmucsc)   cscmucsc<long double>; 
+%template(cscmucsc)   cscmucsc<npy_cfloat>; 
+%template(cscmucsc)   cscmucsc<npy_cdouble>; 
+%template(cscmucsc)   cscmucsc<npy_clongdouble>; 
+
+/*
+ * CSR*x and CSC*x
+ */
+%template(csrmux)   csrmux<float>; 
+%template(csrmux)   csrmux<double>; 
+%template(csrmux)   csrmux<long double>; 
+%template(csrmux)   csrmux<npy_cfloat>; 
+%template(csrmux)   csrmux<npy_cdouble>; 
+%template(csrmux)   csrmux<npy_clongdouble>; 
+
+%template(cscmux)   cscmux<float>; 
+%template(cscmux)   cscmux<double>; 
+%template(cscmux)   cscmux<long double>; 
+%template(cscmux)   cscmux<npy_cfloat>; 
+%template(cscmux)   cscmux<npy_cdouble>; 
+%template(cscmux)   cscmux<npy_clongdouble>; 
+
+
+/*
+ * CSR(elmul)CSR and CSC(elmul)CSC
+ */
+%template(csrelmulcsr)   csrelmulcsr<float>; 
+%template(csrelmulcsr)   csrelmulcsr<double>; 
+%template(csrelmulcsr)   csrelmulcsr<long double>; 
+%template(csrelmulcsr)   csrelmulcsr<npy_cfloat>; 
+%template(csrelmulcsr)   csrelmulcsr<npy_cdouble>; 
+%template(csrelmulcsr)   csrelmulcsr<npy_clongdouble>; 
+
+%template(cscelmulcsc)   cscelmulcsc<float>; 
+%template(cscelmulcsc)   cscelmulcsc<double>; 
+%template(cscelmulcsc)   cscelmulcsc<long double>; 
+%template(cscelmulcsc)   cscelmulcsc<npy_cfloat>; 
+%template(cscelmulcsc)   cscelmulcsc<npy_cdouble>; 
+%template(cscelmulcsc)   cscelmulcsc<npy_clongdouble>; 
+
+
+/*
+ * spdiags->CSC
+ */
+%template(spdiags)   spdiags<float>; 
+%template(spdiags)   spdiags<double>; 
+%template(spdiags)   spdiags<long double>; 
+%template(spdiags)   spdiags<npy_cfloat>; 
+%template(spdiags)   spdiags<npy_cdouble>; 
+%template(spdiags)   spdiags<npy_clongdouble>; 
+
+
+/*
+ * CSR<->Dense
+ */
+%template(csrtodense)   csrtodense<float>; 
+%template(csrtodense)   csrtodense<double>; 
+%template(csrtodense)   csrtodense<long double>; 
+%template(csrtodense)   csrtodense<npy_cfloat>; 
+%template(csrtodense)   csrtodense<npy_cdouble>; 
+%template(csrtodense)   csrtodense<npy_clongdouble>; 
+
+%template(densetocsr)   densetocsr<float>; 
+%template(densetocsr)   densetocsr<double>; 
+%template(densetocsr)   densetocsr<long double>; 
+%template(densetocsr)   densetocsr<npy_cfloat>; 
+%template(densetocsr)   densetocsr<npy_cdouble>; 
+%template(densetocsr)   densetocsr<npy_clongdouble>; 

Added: trunk/Lib/sparse/sparsetools/sparsetools.py
===================================================================
--- trunk/Lib/sparse/sparsetools/sparsetools.py	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/sparsetools/sparsetools.py	2007-01-06 06:34:41 UTC (rev 2496)
@@ -0,0 +1,398 @@
+# This file was created automatically by SWIG 1.3.28.
+# Don't modify this file, modify the SWIG interface instead.
+# This file is compatible with both classic and new-style classes.
+
+import _sparsetools
+import new
+new_instancemethod = new.instancemethod
+def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
+    if (name == "thisown"): return self.this.own(value)
+    if (name == "this"):
+        if type(value).__name__ == 'PySwigObject':
+            self.__dict__[name] = value
+            return
+    method = class_type.__swig_setmethods__.get(name,None)
+    if method: return method(self,value)
+    if (not static) or hasattr(self,name):
+        self.__dict__[name] = value
+    else:
+        raise AttributeError("You cannot add attributes to %s" % self)
+
+def _swig_setattr(self,class_type,name,value):
+    return _swig_setattr_nondynamic(self,class_type,name,value,0)
+
+def _swig_getattr(self,class_type,name):
+    if (name == "thisown"): return self.this.own()
+    method = class_type.__swig_getmethods__.get(name,None)
+    if method: return method(self)
+    raise AttributeError,name
+
+import types
+try:
+    _object = types.ObjectType
+    _newclass = 1
+except AttributeError:
+    class _object : pass
+    _newclass = 0
+del types
+
+
+
+
+def csrtocsc(*args):
+    """
+    csrtocsc(int n_row, int n_col, int Ap, int Aj, float Ax, std::vector<(int)> Bp, 
+        std::vector<(int)> Bi, std::vector<(float)> Bx)
+    csrtocsc(int n_row, int n_col, int Ap, int Aj, double Ax, std::vector<(int)> Bp, 
+        std::vector<(int)> Bi, std::vector<(double)> Bx)
+    csrtocsc(int n_row, int n_col, int Ap, int Aj, long double Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bi, 
+        std::vector<(long double)> Bx)
+    csrtocsc(int n_row, int n_col, int Ap, int Aj, npy_cfloat Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bi, 
+        std::vector<(npy_cfloat)> Bx)
+    csrtocsc(int n_row, int n_col, int Ap, int Aj, npy_cdouble Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bi, 
+        std::vector<(npy_cdouble)> Bx)
+    csrtocsc(int n_row, int n_col, int Ap, int Aj, npy_clongdouble Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bi, 
+        std::vector<(npy_clongdouble)> Bx)
+    """
+    return _sparsetools.csrtocsc(*args)
+
+def csctocsr(*args):
+    """
+    csctocsr(int n_row, int n_col, int Ap, int Ai, float Ax, std::vector<(int)> Bp, 
+        std::vector<(int)> Bj, std::vector<(float)> Bx)
+    csctocsr(int n_row, int n_col, int Ap, int Ai, double Ax, std::vector<(int)> Bp, 
+        std::vector<(int)> Bj, std::vector<(double)> Bx)
+    csctocsr(int n_row, int n_col, int Ap, int Ai, long double Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(long double)> Bx)
+    csctocsr(int n_row, int n_col, int Ap, int Ai, npy_cfloat Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(npy_cfloat)> Bx)
+    csctocsr(int n_row, int n_col, int Ap, int Ai, npy_cdouble Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(npy_cdouble)> Bx)
+    csctocsr(int n_row, int n_col, int Ap, int Ai, npy_clongdouble Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(npy_clongdouble)> Bx)
+    """
+    return _sparsetools.csctocsr(*args)
+
+def csrtocoo(*args):
+    """
+    csrtocoo(int n_row, int n_col, int Ap, int Aj, float Ax, std::vector<(int)> Bi, 
+        std::vector<(int)> Bj, std::vector<(float)> Bx)
+    csrtocoo(int n_row, int n_col, int Ap, int Aj, double Ax, std::vector<(int)> Bi, 
+        std::vector<(int)> Bj, std::vector<(double)> Bx)
+    csrtocoo(int n_row, int n_col, int Ap, int Aj, long double Ax, 
+        std::vector<(int)> Bi, std::vector<(int)> Bj, 
+        std::vector<(long double)> Bx)
+    csrtocoo(int n_row, int n_col, int Ap, int Aj, npy_cfloat Ax, 
+        std::vector<(int)> Bi, std::vector<(int)> Bj, 
+        std::vector<(npy_cfloat)> Bx)
+    csrtocoo(int n_row, int n_col, int Ap, int Aj, npy_cdouble Ax, 
+        std::vector<(int)> Bi, std::vector<(int)> Bj, 
+        std::vector<(npy_cdouble)> Bx)
+    csrtocoo(int n_row, int n_col, int Ap, int Aj, npy_clongdouble Ax, 
+        std::vector<(int)> Bi, std::vector<(int)> Bj, 
+        std::vector<(npy_clongdouble)> Bx)
+    """
+    return _sparsetools.csrtocoo(*args)
+
+def cootocsr(*args):
+    """
+    cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, float Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(float)> Bx)
+    cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, double Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(double)> Bx)
+    cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, long double Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(long double)> Bx)
+    cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cfloat Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(npy_cfloat)> Bx)
+    cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cdouble Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(npy_cdouble)> Bx)
+    cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_clongdouble Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(npy_clongdouble)> Bx)
+    """
+    return _sparsetools.cootocsr(*args)
+
+def csctocoo(*args):
+    """
+    csctocoo(int n_row, int n_col, int Ap, int Ai, float Ax, std::vector<(int)> Bi, 
+        std::vector<(int)> Bj, std::vector<(float)> Bx)
+    csctocoo(int n_row, int n_col, int Ap, int Ai, double Ax, std::vector<(int)> Bi, 
+        std::vector<(int)> Bj, std::vector<(double)> Bx)
+    csctocoo(int n_row, int n_col, int Ap, int Ai, long double Ax, 
+        std::vector<(int)> Bi, std::vector<(int)> Bj, 
+        std::vector<(long double)> Bx)
+    csctocoo(int n_row, int n_col, int Ap, int Ai, npy_cfloat Ax, 
+        std::vector<(int)> Bi, std::vector<(int)> Bj, 
+        std::vector<(npy_cfloat)> Bx)
+    csctocoo(int n_row, int n_col, int Ap, int Ai, npy_cdouble Ax, 
+        std::vector<(int)> Bi, std::vector<(int)> Bj, 
+        std::vector<(npy_cdouble)> Bx)
+    csctocoo(int n_row, int n_col, int Ap, int Ai, npy_clongdouble Ax, 
+        std::vector<(int)> Bi, std::vector<(int)> Bj, 
+        std::vector<(npy_clongdouble)> Bx)
+    """
+    return _sparsetools.csctocoo(*args)
+
+def cootocsc(*args):
+    """
+    cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, float Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bi, 
+        std::vector<(float)> Bx)
+    cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, double Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bi, 
+        std::vector<(double)> Bx)
+    cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, long double Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bi, 
+        std::vector<(long double)> Bx)
+    cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cfloat Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bi, 
+        std::vector<(npy_cfloat)> Bx)
+    cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cdouble Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bi, 
+        std::vector<(npy_cdouble)> Bx)
+    cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_clongdouble Ax, 
+        std::vector<(int)> Bp, std::vector<(int)> Bi, 
+        std::vector<(npy_clongdouble)> Bx)
+    """
+    return _sparsetools.cootocsc(*args)
+
+def csrplcsr(*args):
+    """
+    csrplcsr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, 
+        int Bj, float Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(float)> Cx)
+    csrplcsr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, 
+        int Bj, double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(double)> Cx)
+    csrplcsr(int n_row, int n_col, int Ap, int Aj, long double Ax, 
+        int Bp, int Bj, long double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(long double)> Cx)
+    csrplcsr(int n_row, int n_col, int Ap, int Aj, npy_cfloat Ax, 
+        int Bp, int Bj, npy_cfloat Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(npy_cfloat)> Cx)
+    csrplcsr(int n_row, int n_col, int Ap, int Aj, npy_cdouble Ax, 
+        int Bp, int Bj, npy_cdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(npy_cdouble)> Cx)
+    csrplcsr(int n_row, int n_col, int Ap, int Aj, npy_clongdouble Ax, 
+        int Bp, int Bj, npy_clongdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(npy_clongdouble)> Cx)
+    """
+    return _sparsetools.csrplcsr(*args)
+
+def cscplcsc(*args):
+    """
+    cscplcsc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, 
+        int Bi, float Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(float)> Cx)
+    cscplcsc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, 
+        int Bi, double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(double)> Cx)
+    cscplcsc(int n_row, int n_col, int Ap, int Ai, long double Ax, 
+        int Bp, int Bi, long double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(long double)> Cx)
+    cscplcsc(int n_row, int n_col, int Ap, int Ai, npy_cfloat Ax, 
+        int Bp, int Bi, npy_cfloat Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(npy_cfloat)> Cx)
+    cscplcsc(int n_row, int n_col, int Ap, int Ai, npy_cdouble Ax, 
+        int Bp, int Bi, npy_cdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(npy_cdouble)> Cx)
+    cscplcsc(int n_row, int n_col, int Ap, int Ai, npy_clongdouble Ax, 
+        int Bp, int Bi, npy_clongdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(npy_clongdouble)> Cx)
+    """
+    return _sparsetools.cscplcsc(*args)
+
+def csrmucsr(*args):
+    """
+    csrmucsr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, 
+        int Bj, float Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(float)> Cx)
+    csrmucsr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, 
+        int Bj, double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(double)> Cx)
+    csrmucsr(int n_row, int n_col, int Ap, int Aj, long double Ax, 
+        int Bp, int Bj, long double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(long double)> Cx)
+    csrmucsr(int n_row, int n_col, int Ap, int Aj, npy_cfloat Ax, 
+        int Bp, int Bj, npy_cfloat Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(npy_cfloat)> Cx)
+    csrmucsr(int n_row, int n_col, int Ap, int Aj, npy_cdouble Ax, 
+        int Bp, int Bj, npy_cdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(npy_cdouble)> Cx)
+    csrmucsr(int n_row, int n_col, int Ap, int Aj, npy_clongdouble Ax, 
+        int Bp, int Bj, npy_clongdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(npy_clongdouble)> Cx)
+    """
+    return _sparsetools.csrmucsr(*args)
+
+def cscmucsc(*args):
+    """
+    cscmucsc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, 
+        int Bi, float Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(float)> Cx)
+    cscmucsc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, 
+        int Bi, double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(double)> Cx)
+    cscmucsc(int n_row, int n_col, int Ap, int Ai, long double Ax, 
+        int Bp, int Bi, long double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(long double)> Cx)
+    cscmucsc(int n_row, int n_col, int Ap, int Ai, npy_cfloat Ax, 
+        int Bp, int Bi, npy_cfloat Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(npy_cfloat)> Cx)
+    cscmucsc(int n_row, int n_col, int Ap, int Ai, npy_cdouble Ax, 
+        int Bp, int Bi, npy_cdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(npy_cdouble)> Cx)
+    cscmucsc(int n_row, int n_col, int Ap, int Ai, npy_clongdouble Ax, 
+        int Bp, int Bi, npy_clongdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(npy_clongdouble)> Cx)
+    """
+    return _sparsetools.cscmucsc(*args)
+
+def csrmux(*args):
+    """
+    csrmux(int n_row, int n_col, int Ap, int Aj, float Ax, float Xx, 
+        std::vector<(float)> Yx)
+    csrmux(int n_row, int n_col, int Ap, int Aj, double Ax, double Xx, 
+        std::vector<(double)> Yx)
+    csrmux(int n_row, int n_col, int Ap, int Aj, long double Ax, 
+        long double Xx, std::vector<(long double)> Yx)
+    csrmux(int n_row, int n_col, int Ap, int Aj, npy_cfloat Ax, 
+        npy_cfloat Xx, std::vector<(npy_cfloat)> Yx)
+    csrmux(int n_row, int n_col, int Ap, int Aj, npy_cdouble Ax, 
+        npy_cdouble Xx, std::vector<(npy_cdouble)> Yx)
+    csrmux(int n_row, int n_col, int Ap, int Aj, npy_clongdouble Ax, 
+        npy_clongdouble Xx, std::vector<(npy_clongdouble)> Yx)
+    """
+    return _sparsetools.csrmux(*args)
+
+def cscmux(*args):
+    """
+    cscmux(int n_row, int n_col, int Ap, int Ai, float Ax, float Xx, 
+        std::vector<(float)> Yx)
+    cscmux(int n_row, int n_col, int Ap, int Ai, double Ax, double Xx, 
+        std::vector<(double)> Yx)
+    cscmux(int n_row, int n_col, int Ap, int Ai, long double Ax, 
+        long double Xx, std::vector<(long double)> Yx)
+    cscmux(int n_row, int n_col, int Ap, int Ai, npy_cfloat Ax, 
+        npy_cfloat Xx, std::vector<(npy_cfloat)> Yx)
+    cscmux(int n_row, int n_col, int Ap, int Ai, npy_cdouble Ax, 
+        npy_cdouble Xx, std::vector<(npy_cdouble)> Yx)
+    cscmux(int n_row, int n_col, int Ap, int Ai, npy_clongdouble Ax, 
+        npy_clongdouble Xx, std::vector<(npy_clongdouble)> Yx)
+    """
+    return _sparsetools.cscmux(*args)
+
+def csrelmulcsr(*args):
+    """
+    csrelmulcsr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, 
+        int Bj, float Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(float)> Cx)
+    csrelmulcsr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, 
+        int Bj, double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(double)> Cx)
+    csrelmulcsr(int n_row, int n_col, int Ap, int Aj, long double Ax, 
+        int Bp, int Bj, long double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(long double)> Cx)
+    csrelmulcsr(int n_row, int n_col, int Ap, int Aj, npy_cfloat Ax, 
+        int Bp, int Bj, npy_cfloat Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(npy_cfloat)> Cx)
+    csrelmulcsr(int n_row, int n_col, int Ap, int Aj, npy_cdouble Ax, 
+        int Bp, int Bj, npy_cdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(npy_cdouble)> Cx)
+    csrelmulcsr(int n_row, int n_col, int Ap, int Aj, npy_clongdouble Ax, 
+        int Bp, int Bj, npy_clongdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Cj, std::vector<(npy_clongdouble)> Cx)
+    """
+    return _sparsetools.csrelmulcsr(*args)
+
+def cscelmulcsc(*args):
+    """
+    cscelmulcsc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, 
+        int Bi, float Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(float)> Cx)
+    cscelmulcsc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, 
+        int Bi, double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(double)> Cx)
+    cscelmulcsc(int n_row, int n_col, int Ap, int Ai, long double Ax, 
+        int Bp, int Bi, long double Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(long double)> Cx)
+    cscelmulcsc(int n_row, int n_col, int Ap, int Ai, npy_cfloat Ax, 
+        int Bp, int Bi, npy_cfloat Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(npy_cfloat)> Cx)
+    cscelmulcsc(int n_row, int n_col, int Ap, int Ai, npy_cdouble Ax, 
+        int Bp, int Bi, npy_cdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(npy_cdouble)> Cx)
+    cscelmulcsc(int n_row, int n_col, int Ap, int Ai, npy_clongdouble Ax, 
+        int Bp, int Bi, npy_clongdouble Bx, std::vector<(int)> Cp, 
+        std::vector<(int)> Ci, std::vector<(npy_clongdouble)> Cx)
+    """
+    return _sparsetools.cscelmulcsc(*args)
+
+def spdiags(*args):
+    """
+    spdiags(int n_row, int n_col, int n_diag, int offsets, float diags, 
+        std::vector<(int)> Ap, std::vector<(int)> Ai, 
+        std::vector<(float)> Ax)
+    spdiags(int n_row, int n_col, int n_diag, int offsets, double diags, 
+        std::vector<(int)> Ap, std::vector<(int)> Ai, 
+        std::vector<(double)> Ax)
+    spdiags(int n_row, int n_col, int n_diag, int offsets, long double diags, 
+        std::vector<(int)> Ap, std::vector<(int)> Ai, 
+        std::vector<(long double)> Ax)
+    spdiags(int n_row, int n_col, int n_diag, int offsets, npy_cfloat diags, 
+        std::vector<(int)> Ap, std::vector<(int)> Ai, 
+        std::vector<(npy_cfloat)> Ax)
+    spdiags(int n_row, int n_col, int n_diag, int offsets, npy_cdouble diags, 
+        std::vector<(int)> Ap, std::vector<(int)> Ai, 
+        std::vector<(npy_cdouble)> Ax)
+    spdiags(int n_row, int n_col, int n_diag, int offsets, npy_clongdouble diags, 
+        std::vector<(int)> Ap, std::vector<(int)> Ai, 
+        std::vector<(npy_clongdouble)> Ax)
+    """
+    return _sparsetools.spdiags(*args)
+
+def csrtodense(*args):
+    """
+    csrtodense(int n_row, int n_col, int Ap, int Aj, float Ax, float Mx)
+    csrtodense(int n_row, int n_col, int Ap, int Aj, double Ax, double Mx)
+    csrtodense(int n_row, int n_col, int Ap, int Aj, long double Ax, 
+        long double Mx)
+    csrtodense(int n_row, int n_col, int Ap, int Aj, npy_cfloat Ax, 
+        npy_cfloat Mx)
+    csrtodense(int n_row, int n_col, int Ap, int Aj, npy_cdouble Ax, 
+        npy_cdouble Mx)
+    csrtodense(int n_row, int n_col, int Ap, int Aj, npy_clongdouble Ax, 
+        npy_clongdouble Mx)
+    """
+    return _sparsetools.csrtodense(*args)
+
+def densetocsr(*args):
+    """
+    densetocsr(int n_row, int n_col, float Mx, std::vector<(int)> Ap, 
+        std::vector<(int)> Aj, std::vector<(float)> Ax)
+    densetocsr(int n_row, int n_col, double Mx, std::vector<(int)> Ap, 
+        std::vector<(int)> Aj, std::vector<(double)> Ax)
+    densetocsr(int n_row, int n_col, long double Mx, std::vector<(int)> Ap, 
+        std::vector<(int)> Aj, std::vector<(long double)> Ax)
+    densetocsr(int n_row, int n_col, npy_cfloat Mx, std::vector<(int)> Ap, 
+        std::vector<(int)> Aj, std::vector<(npy_cfloat)> Ax)
+    densetocsr(int n_row, int n_col, npy_cdouble Mx, std::vector<(int)> Ap, 
+        std::vector<(int)> Aj, std::vector<(npy_cdouble)> Ax)
+    densetocsr(int n_row, int n_col, npy_clongdouble Mx, std::vector<(int)> Ap, 
+        std::vector<(int)> Aj, std::vector<(npy_clongdouble)> Ax)
+    """
+    return _sparsetools.densetocsr(*args)
+

Deleted: trunk/Lib/sparse/sparsetools/sparsetools.pyf.src
===================================================================
--- trunk/Lib/sparse/sparsetools/sparsetools.pyf.src	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/sparsetools/sparsetools.pyf.src	2007-01-06 06:34:41 UTC (rev 2496)
@@ -1,240 +0,0 @@
-!    -*- f90 -*-
-python module sparsetools ! in 
-    interface  ! in :sparsetools
-        subroutine <_c>cscadd(n,a,rowa,ptra,nnzamax,b,rowb,ptrb,nnzbmax,c,rowc,ptrc,nnzcmax,ierr) ! in :sparsetools:dspblas.f
-            integer intent(hide),depend(ptra) :: n=(len(ptra)-1)
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax),depend(nnzamax) :: rowa
-            integer dimension(n + 1) :: ptra
-            integer intent(hide),depend(a) :: nnzamax=len(a)
-            <_t> dimension(nnzbmax) :: b
-            integer dimension(nnzbmax),depend(nnzbmax) :: rowb
-            integer dimension(n + 1) :: ptrb
-            integer intent(hide),depend(b) :: nnzbmax=len(b)
-            <_t> intent(out), dimension(nnzcmax), depend(nnzcmax) :: c
-            integer intent(out),dimension(nnzcmax),depend(nnzcmax) :: rowc
-            integer intent(out),dimension(n + 1),depend(n) :: ptrc
-            integer intent(hide),depend(nnzamax,nnzbmax) :: nnzcmax=nnzamax+nnzbmax
-            integer intent(out) :: ierr
-        end subroutine <_c>cscadd
-
-        subroutine <_c>cscmul(n,a,rowa,ptra,nnzamax,b,rowb,ptrb,nnzbmax,c,rowc,ptrc,nnzcmax,ierr) ! in :sparsetools:dspblas.f
-            integer intent(hide),depend(ptra) :: n=(len(ptra)-1)
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax),depend(nnzamax) :: rowa
-            integer dimension(n + 1) :: ptra
-            integer intent(hide),depend(a) :: nnzamax=len(a)
-            <_t> dimension(nnzbmax) :: b
-            integer dimension(nnzbmax),depend(nnzbmax) :: rowb
-            integer dimension(n + 1) :: ptrb
-            integer intent(hide),depend(b) :: nnzbmax=len(b)
-            <_t> intent(out), dimension(nnzcmax), depend(nnzcmax) :: c
-            integer intent(out),dimension(nnzcmax),depend(nnzcmax) :: rowc
-            integer intent(out),dimension(n + 1),depend(n) :: ptrc
-            integer intent(hide),depend(nnzamax,nnzbmax) :: nnzcmax=nnzamax+nnzbmax
-            integer intent(out) :: ierr
-        end subroutine <_c>cscmul
-
-        subroutine <_c>cscmux(a,rowa,ptra,nnzamax,ncol,x,mrow,y) ! in :sparsetools:dspblas.f
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax),depend(nnzamax) :: rowa
-            integer dimension(ncol + 1) :: ptra
-            integer intent(hide),depend(a) :: nnzamax=len(a)
-            integer intent(hide),depend(ptra) :: ncol=(len(ptra)-1)
-            <_t> dimension(ncol),depend(ncol) :: x
-            integer intent(in) :: mrow
-            <_t> intent(out), dimension(mrow), depend(mrow) :: y
-        end subroutine <_c>cscmux
-
-        subroutine <_c>csrmux(a,cola,ptra,nnzamax,ncol,x,mrow,y) ! in :sparsetools:dspblas.f
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax),depend(nnzamax) :: cola
-            integer dimension(mrow + 1) :: ptra
-            integer intent(hide),depend(a) :: nnzamax=len(a)
-            integer intent(hide),depend(x) :: ncol=len(x)
-            <_t> dimension(ncol) :: x
-            integer intent(hide),depend(ptra) :: mrow=(len(ptra)-1)
-            <_t> intent(out),dimension(mrow),depend(mrow) :: y
-        end subroutine <_c>csrmux
-
-        subroutine <_c>cscmucsr(m,k,n,a,rowa,ptra,nnzamax,b,colb,ptrb,nnzbmax,c,rowc,ptrc,nnzcmax,irow,kcol,ierr) ! in :sparsetools:dspblas.f
-            integer :: m
-            integer intent(hide),depend(ptra) :: k=(len(ptra)-1)
-            integer intent(hide),depend(ptrc) :: n=(len(ptrc)-1)
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax),depend(nnzamax) :: rowa
-            integer dimension(k + 1) :: ptra
-            integer intent(hide),depend(a) :: nnzamax=len(a)
-            <_t> dimension(nnzbmax) :: b
-            integer dimension(nnzbmax),depend(nnzbmax) :: colb
-            integer dimension(k + 1),depend(k) :: ptrb
-            integer intent(hide),depend(b) :: nnzbmax=len(b)
-            <_t> intent(in, out), dimension(nnzcmax) :: c
-            integer intent(in, out), dimension(nnzcmax),depend(nnzcmax) :: rowc
-            integer intent(in, out), dimension(n + 1) :: ptrc
-            integer intent(hide), depend(c) :: nnzcmax=len(c)
-            integer intent(in, out) :: irow
-            integer intent(in, out) :: kcol
-            integer intent(in, out) :: ierr
-        end subroutine <_c>cscmucsr
-
-        subroutine <_c>csrmucsc(m,n,a,rowa,ptra,nnzamax,b,colb,ptrb,nnzbmax,c,rowc,ptrc,nnzcmax,irow,kcol,ierr) ! in :sparsetools:dspblas.f
-            integer intent(hide), depend(ptra) :: m=(len(ptra)-1)
-            integer intent(hide), depend(ptrb) :: n=(len(ptrb)-1)
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax), depend(nnzamax) :: rowa
-            integer dimension(m + 1) :: ptra
-            integer intent(hide), depend(a) :: nnzamax=len(a)
-            <_t> dimension(nnzbmax) :: b
-            integer dimension(nnzbmax),depend(nnzbmax) :: colb
-            integer dimension(n + 1) :: ptrb
-            integer intent(hide), depend(b) :: nnzbmax=len(b)
-            <_t> intent(in,out),dimension(nnzcmax) :: c
-            integer intent(in, out), dimension(nnzcmax),depend(nnzcmax) :: rowc
-            integer intent(in, out), dimension(n + 1), depend(n) :: ptrc
-            integer intent(hide), depend(c) :: nnzcmax=len(c)
-            integer intent(in, out) :: irow
-            integer intent(in, out) :: kcol
-            integer intent(in, out) :: ierr
-        end subroutine <_c>csrmucsc
-
-        subroutine <_c>cscmucsc(m,k,n,a,rowa,ptra,nnzamax,b,colb,ptrb,nnzbmax,c,rowc,ptrc,nnzcmax,irow,kcol,ierr) ! in :sparsetools:dspblas.f
-            integer :: m
-            integer intent(hide),depend(ptra) :: k=(len(ptra)-1)
-            integer intent(hide),depend(ptrb) :: n=(len(ptrb)-1)
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax),depend(nnzamax) :: rowa
-            integer dimension(k + 1) :: ptra
-            integer intent(hide),depend(a) :: nnzamax=len(a)
-            <_t> dimension(nnzbmax) :: b
-            integer dimension(nnzbmax),depend(nnzbmax) :: colb
-            integer dimension(n + 1) :: ptrb
-            integer intent(hide), depend(b) :: nnzbmax=len(b)
-            <_t> intent(in, out),dimension(nnzcmax) :: c
-            integer intent(in, out), dimension(nnzcmax),depend(nnzcmax) :: rowc
-            integer intent(in, out), dimension(n + 1), depend(n) :: ptrc
-            integer intent(hide), depend(c) :: nnzcmax=len(c)
-            integer intent(in, out) :: irow
-            integer intent(in, out) :: kcol
-            integer intent(in, out) :: ierr
-        end subroutine <_c>cscmucsc
-
-        subroutine <_c>transp(m,n,a,rowa,ptra,nnzamax,b,colb,ptrb) ! in :sparsetools:dspconv.f
-            integer intent(in) :: m
-            integer intent(hide), depend(ptra) :: n=(len(ptra)-1)
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax),depend(nnzamax) :: rowa
-            integer dimension(n + 1) :: ptra
-            integer intent(hide), depend(a) :: nnzamax=len(a)
-            <_t> intent(out),dimension(nnzamax),depend(nnzamax) :: b
-            integer intent(out), dimension(nnzamax),depend(nnzamax) :: colb
-            integer intent(out), dimension(m + 1), depend(m) :: ptrb
-        end subroutine <_c>transp
-
-        subroutine <_c>cscgetel(a,rowa,ptra,nnzamax,n,row,col,ind,val) ! in :sparsetools:dspconv.f
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax),depend(nnzamax) :: rowa
-            integer dimension(n + 1) :: ptra
-            integer intent(hide), depend(a) :: nnzamax=len(a)
-            integer intent(hide), depend(ptra) :: n=(len(ptra)-1)
-            integer check((row >=0)) :: row
-            integer check(((col >= 0) && (col < n))), depend(n) :: col
-            integer intent(out) :: ind
-            <_t> intent(out) :: val
-        end subroutine <_c>cscgetel
-
-        subroutine <_c>cscsetel(a,rowa,ptra,nnzamax,n,row,col,val) ! in :sparsetools:dspconv.f
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax),depend(nnzamax) :: rowa
-            integer dimension(n + 1) :: ptra
-            integer intent(hide),depend(a) :: nnzamax=len(a)
-            integer intent(hide),depend(ptra) :: n=(len(ptra)-1)
-            integer :: row
-            integer :: col
-            <_t> :: val
-        end subroutine <_c>cscsetel
-
-        subroutine <_c>cootocsc(n,vals,row,col,nnz,a,rowa,ptra,nnzamax,ierr) ! in :sparsetools:dspconv.f
-            integer intent(in) :: n
-            <_t> dimension(nnz) :: vals
-            integer dimension(nnz),depend(nnz) :: row
-            integer dimension(nnz),depend(nnz) :: col
-            integer intent(hide), depend(vals) :: nnz=len(vals)
-            <_t> intent(out), dimension(nnzamax), depend(nnzamax) :: a
-            integer intent(out), dimension(nnzamax),depend(nnzamax) :: rowa
-            integer intent(out), dimension(n + 1), depend(n) :: ptra
-            integer intent(hide), depend(nnz) :: nnzamax=nnz
-            integer intent(out) :: ierr
-        end subroutine <_c>cootocsc
-
-        subroutine <_c>csctocoo(n, vals, row, col, a, rowa, ptra, nnzamax)
-            integer intent(hide),depend(ptra) :: n=(len(ptra)-1)
-            integer intent(in), dimension(n + 1) :: ptra
-            <_t> intent(in), dimension(nnzamax), depend(nnzamax) :: a
-            integer intent(hide), depend(rowa) :: nnzamax=len(rowa)
-            integer dimension(nnzamax),intent(in) :: rowa
-            integer dimension(ptra[n]),intent(out),depend(n,ptra) :: row,col
-            <_t> dimension(ptra[n]),intent(out),depend(n,ptra) :: vals
-        end subroutine <_c>csctocoo
-
-        subroutine <_c>fulltocsc(m,n,fulla,a,rowa,ptra,nnzamax,irow,jcol,ierr) ! in :sparsetools:dspconv.f
-            integer intent(hide), depend(fulla) :: m=shape(fulla,0)
-            integer intent(hide), depend(fulla) :: n=shape(fulla,1)
-            <_t> dimension(m,n) :: fulla
-            <_t> intent(in,out),dimension(nnzamax) :: a
-            integer intent(in,out),dimension(nnzamax),depend(nnzamax) :: rowa
-            integer intent(in,out),dimension(n + 1),depend(n) :: ptra
-            integer intent(hide),depend(a) :: nnzamax=len(a)
-            integer intent(in,out) :: irow
-            integer intent(in,out) :: jcol
-            integer intent(in,out) :: ierr
-        end subroutine <_c>fulltocsc
-
-        subroutine <_c>csctofull(m,n,fulla,a,rowa,ptra,nnzamax) ! in :sparsetools:dspconv.f
-            integer intent(in) :: m
-            integer intent(hide),depend(ptra) :: n = (len(ptra)-1)
-            <_t> intent(out), dimension(m,n), depend(m,n) :: fulla
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax),depend(nnzamax) :: rowa
-            integer dimension(n + 1) :: ptra
-            integer intent(hide), depend(a) :: nnzamax=len(a)
-        end subroutine <_c>csctofull
-
-        subroutine <_c>cscextract(n,a,rowa,ptra,nnzamax,ibeg,iend,jbeg,jend,c,rowc,ptrc,nnzcmax,irow,jcol,ierr) ! in :sparsetools:dspconv.f
-            integer intent(hide),depend(ptra) :: n=(len(ptra)-1)
-            <_t> dimension(nnzamax) :: a
-            integer dimension(nnzamax),depend(nnzamax) :: rowa
-            integer dimension(n + 1) :: ptra
-            integer intent(hide),depend(a) :: nnzamax=len(a)
-            integer :: ibeg
-            integer :: iend
-            integer :: jbeg
-            integer :: jend
-            <_t> intent(in,out),dimension(nnzcmax) :: c
-            integer intent(in,out),dimension(nnzamax),depend(nnzamax) :: rowc
-            integer intent(in,out),dimension(jend-jbeg+1+1),depend(jbeg,jend) :: ptrc
-            integer intent(hide),depend(c) :: nnzcmax=len(c)
-            integer intent(in,out) :: irow
-            integer intent(in,out) :: jcol
-            integer intent(in,out) :: ierr
-        end subroutine <_c>cscextract
-
-        subroutine <_c>diatocsc(m,n,diags,numdia,diasize,offsets,a,rowa,ptra,nzmax,ierr)
-            integer :: m
-            integer :: n
-            <_t> dimension(numdia, diasize) :: diags
-            integer intent(hide), depend(diags) :: numdia=shape(diags,0)
-            integer intent(hide), depend(diags) :: diasize=shape(diags,1)
-            integer dimension(numdia) :: offsets
-            <_t> intent(out), dimension(nzmax), depend(nzmax) :: a
-            integer intent(out), dimension(nzmax), depend(nzmax) :: rowa
-            integer intent(out), dimension(n+1), depend(n) :: ptra
-            integer intent(hide), depend(numdia,diasize,diags) :: nzmax=numdia*diasize
-            integer intent(out) :: ierr            
-        end subroutine <_c>diatocsc
-
-    end interface 
-end python module sparsetools
-
-! this file was auto-generated with f2py (version:2.39.235_1702).
-! see http://cens.ioc.ee/projects/f2py2e/

Added: trunk/Lib/sparse/sparsetools/sparsetools_wrap.cxx
===================================================================
--- trunk/Lib/sparse/sparsetools/sparsetools_wrap.cxx	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/sparsetools/sparsetools_wrap.cxx	2007-01-06 06:34:41 UTC (rev 2496)
@@ -0,0 +1,21677 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.28
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPYTHON
+#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
+
+#ifdef __cplusplus
+template<class T> class SwigValueWrapper {
+    T *tt;
+public:
+    SwigValueWrapper() : tt(0) { }
+    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
+    SwigValueWrapper(const T& t) : tt(new T(t)) { }
+    ~SwigValueWrapper() { delete tt; } 
+    SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
+    operator T&() const { return *tt; }
+    T *operator&() { return tt; }
+private:
+    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+};
+#endif
+
+/***********************************************************************
+ *
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ *
+ ************************************************************************/
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC)
+#   if (__SUNPRO_CC <= 0x560)
+#     define SWIGTEMPLATEDISAMBIGUATOR template
+#   else
+#     define SWIGTEMPLATEDISAMBIGUATOR 
+#   endif
+# else
+#   define SWIGTEMPLATEDISAMBIGUATOR 
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods for Windows DLLs */
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   define SWIGEXPORT
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+
+/* Python.h has to appear first */
+#include <Python.h>
+
+/***********************************************************************
+ * swigrun.swg
+ *
+ *     This file contains generic CAPI SWIG runtime support for pointer
+ *     type checking.
+ *
+ ************************************************************************/
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "2"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the swig runtime code.
+  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  
+  But only do this if is strictly necessary, ie, if you have problems
+  with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+	delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {			       
+          if (<need new object>) {		       
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;		       
+          } else {				       
+            *ptr = <ptr to old object>;	       
+            return SWIG_OLDOBJ;		       
+          } 				       
+        } else {				       
+          return SWIG_BADOBJ;		       
+        }					       
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+ 
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store inforomation on one type */
+typedef struct swig_type_info {
+  const char             *name;			/* mangled name of this type */
+  const char             *str;			/* human readable name of this type */
+  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
+  void                   *clientdata;		/* language specific type data */
+  int                    owndata;		/* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;		/* function to cast the void pointers */
+  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;			/* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;		        /* Number of types in this module */
+  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;	/* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
+  void                    *clientdata;		/* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+		  const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (int)(*f1 - *f2);
+  }
+  return (l1 - f1) - (l2 - f2);
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty)         \
+  if (ty) {                                             \
+    swig_cast_info *iter = ty->cast;                    \
+    while (iter) {                                      \
+      if (comparison) {                                 \
+        if (iter == ty->cast) return iter;              \
+        /* Move iter to the top of the linked list */   \
+        iter->prev->next = iter->next;                  \
+        if (iter->next)                                 \
+          iter->next->prev = iter->prev;                \
+        iter->next = ty->cast;                          \
+        iter->prev = 0;                                 \
+        if (ty->cast) ty->cast->prev = iter;            \
+        ty->cast = iter;                                \
+        return iter;                                    \
+      }                                                 \
+      iter = iter->next;                                \
+    }                                                   \
+  }                                                     \
+  return 0
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+  SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+	SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+		            const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
+	register size_t i = (l + r) >> 1; 
+	const char *iname = iter->types[i]->name;
+	if (iname) {
+	  register int compare = strcmp(name, iname);
+	  if (compare == 0) {	    
+	    return iter->types[i];
+	  } else if (compare < 0) {
+	    if (i) {
+	      r = i - 1;
+	    } else {
+	      break;
+	    }
+	  } else if (compare > 0) {
+	    l = i + 1;
+	  }
+	} else {
+	  break; /* should never happen */
+	}
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+		     const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+	  return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError    	   -1 
+#define  SWIG_IOError        	   -2 
+#define  SWIG_RuntimeError   	   -3 
+#define  SWIG_IndexError     	   -4 
+#define  SWIG_TypeError      	   -5 
+#define  SWIG_DivisionByZero 	   -6 
+#define  SWIG_OverflowError  	   -7 
+#define  SWIG_SyntaxError    	   -8 
+#define  SWIG_ValueError     	   -9 
+#define  SWIG_SystemError    	   -10
+#define  SWIG_AttributeError 	   -11
+#define  SWIG_MemoryError    	   -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+/* Python.h has to appear first */
+#include <Python.h>
+
+/* Add PyOS_snprintf for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
+#   define PyOS_snprintf _snprintf
+# else
+#  define PyOS_snprintf snprintf
+# endif
+#endif
+
+/* A crude PyString_FromFormat implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+
+#ifndef SWIG_PYBUFFER_SIZE
+#define SWIG_PYBUFFER_SIZE 1024
+#endif
+
+static PyObject *
+PyString_FromFormat(const char *fmt, ...) {
+  va_list ap;
+  char buf[SWIG_PYBUFFER_SIZE * 2];
+  int res;
+  va_start(ap, fmt);
+  res = vsnprintf(buf, sizeof(buf), fmt, ap);
+  va_end(ap);
+  return (res < 0 || res >= sizeof(buf)) ? 0 : PyString_FromString(buf);
+}
+#endif
+
+/* Add PyObject_Del for old Pythons */
+#if PY_VERSION_HEX < 0x01060000
+#define PyObject_Del(op) PyMem_DEL((op))
+#endif
+#ifndef PyObject_DEL
+#define PyObject_DEL PyObject_Del
+#endif
+
+/* A crude PyExc_StopIteration exception for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+#define PyExc_StopIteration PyExc_RuntimeError
+#define PyObject_GenericGetAttr 0
+#define Py_NotImplemented PyExc_RuntimeError
+#endif
+
+
+/* A crude PyString_AsStringAndSize implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02010000
+#define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
+#endif
+
+#if PY_VERSION_HEX < 0x02000000
+#define PySequence_Size PySequence_Length
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGRUNTIME PyObject*
+SWIG_Python_ErrorType(int code) {
+  PyObject* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = PyExc_MemoryError;
+    break;
+  case SWIG_IOError:
+    type = PyExc_IOError;
+    break;
+  case SWIG_RuntimeError:
+    type = PyExc_RuntimeError;
+    break;
+  case SWIG_IndexError:
+    type = PyExc_IndexError;
+    break;
+  case SWIG_TypeError:
+    type = PyExc_TypeError;
+    break;
+  case SWIG_DivisionByZero:
+    type = PyExc_ZeroDivisionError;
+    break;
+  case SWIG_OverflowError:
+    type = PyExc_OverflowError;
+    break;
+  case SWIG_SyntaxError:
+    type = PyExc_SyntaxError;
+    break;
+  case SWIG_ValueError:
+    type = PyExc_ValueError;
+    break;
+  case SWIG_SystemError:
+    type = PyExc_SystemError;
+    break;
+  case SWIG_AttributeError:
+    type = PyExc_AttributeError;
+    break;
+  default:
+    type = PyExc_RuntimeError;
+  }
+  return type;
+}
+
+
+SWIGRUNTIME void
+SWIG_Python_AddErrorMsg(const char* mesg)
+{
+  PyObject *type = 0;
+  PyObject *value = 0;
+  PyObject *traceback = 0;
+
+  if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
+  if (value) {
+    PyObject *old_str = PyObject_Str(value);
+    PyErr_Clear();
+    Py_XINCREF(type);
+    PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+    Py_DECREF(old_str);
+    Py_DECREF(value);
+  } else {
+    PyErr_Format(PyExc_RuntimeError, mesg);
+  }
+}
+
+
+
+#if defined(SWIG_PYTHON_NO_THREADS)
+#  if defined(SWIG_PYTHON_THREADS)
+#    undef SWIG_PYTHON_THREADS
+#  endif
+#endif
+#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
+#  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
+#    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
+#      define SWIG_PYTHON_USE_GIL
+#    endif
+#  endif
+#  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
+#    ifndef SWIG_PYTHON_INITIALIZE_THREADS
+#     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() 
+#    endif
+#    ifdef __cplusplus /* C++ code */
+       class SWIG_Python_Thread_Block {
+         bool status;
+         PyGILState_STATE state;
+       public:
+         void end() { if (status) { PyGILState_Release(state); status = false;} }
+         SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
+         ~SWIG_Python_Thread_Block() { end(); }
+       };
+       class SWIG_Python_Thread_Allow {
+         bool status;
+         PyThreadState *save;
+       public:
+         void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
+         SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
+         ~SWIG_Python_Thread_Allow() { end(); }
+       };
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
+#      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
+#      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
+#    else /* C code */
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
+#      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
+#      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
+#    endif
+#  else /* Old thread way, not implemented, user must provide it */
+#    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
+#      define SWIG_PYTHON_INITIALIZE_THREADS
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
+#      define SWIG_PYTHON_THREAD_END_BLOCK
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
+#      define SWIG_PYTHON_THREAD_END_ALLOW
+#    endif
+#  endif
+#else /* No thread support */
+#  define SWIG_PYTHON_INITIALIZE_THREADS
+#  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+#  define SWIG_PYTHON_THREAD_END_BLOCK
+#  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+#  define SWIG_PYTHON_THREAD_END_ALLOW
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Python API portion that goes into the runtime
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* cc-mode */
+#endif
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Constant declarations
+ * ----------------------------------------------------------------------------- */
+
+/* Constant Types */
+#define SWIG_PY_POINTER 4
+#define SWIG_PY_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_const_info {
+  int type;
+  char *name;
+  long lvalue;
+  double dvalue;
+  void   *pvalue;
+  swig_type_info **ptype;
+} swig_const_info;
+
+#ifdef __cplusplus
+#if 0
+{ /* cc-mode */
+#endif
+}
+#endif
+
+
+/***********************************************************************
+ * pyrun.swg
+ *
+ *     This file contains the runtime support for Python modules
+ *     and includes code for managing global variables and pointer
+ *     type checking.
+ *
+ * Author : David Beazley (beazley at cs.uchicago.edu)
+ ************************************************************************/
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
+#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
+#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(ptr, type, flags)
+#define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
+#define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
+#define swig_owntype                                    int
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
+#define SWIG_NewClientData(obj)                         PySwigClientData_New(obj)
+
+#define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
+#define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg				   
+#define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)                        
+#define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
+#define SWIG_fail                        		goto fail					   
+
+
+/* Runtime API implementation */
+
+/* Error manipulation */
+
+SWIGINTERN void 
+SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
+  SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
+  PyErr_SetObject(errtype, obj);
+  Py_DECREF(obj);
+  SWIG_PYTHON_THREAD_END_BLOCK;
+}
+
+SWIGINTERN void 
+SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
+  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+  PyErr_SetString(errtype, (char *) msg);
+  SWIG_PYTHON_THREAD_END_BLOCK;
+}
+
+#define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
+
+/* Set a constant value */
+
+SWIGINTERN void
+SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
+  PyDict_SetItemString(d, (char*) name, obj);
+  Py_DECREF(obj);                            
+}
+
+/* Append a value to the result obj */
+
+SWIGINTERN PyObject*
+SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
+#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
+  if (!result) {
+    result = obj;
+  } else if (result == Py_None) {
+    Py_DECREF(result);
+    result = obj;
+  } else {
+    if (!PyList_Check(result)) {
+      PyObject *o2 = result;
+      result = PyList_New(1);
+      PyList_SetItem(result, 0, o2);
+    }
+    PyList_Append(result,obj);
+    Py_DECREF(obj);
+  }
+  return result;
+#else
+  PyObject*   o2;
+  PyObject*   o3;
+  if (!result) {
+    result = obj;
+  } else if (result == Py_None) {
+    Py_DECREF(result);
+    result = obj;
+  } else {
+    if (!PyTuple_Check(result)) {
+      o2 = result;
+      result = PyTuple_New(1);
+      PyTuple_SET_ITEM(result, 0, o2);
+    }
+    o3 = PyTuple_New(1);
+    PyTuple_SET_ITEM(o3, 0, obj);
+    o2 = result;
+    result = PySequence_Concat(o2, o3);
+    Py_DECREF(o2);
+    Py_DECREF(o3);
+  }
+  return result;
+#endif
+}
+
+/* Unpack the argument tuple */
+
+SWIGINTERN int
+SWIG_Python_UnpackTuple(PyObject *args, const char *name, int min, int max, PyObject **objs)
+{
+  if (!args) {
+    if (!min && !max) {
+      return 1;
+    } else {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
+		   name, (min == max ? "" : "at least "), min);
+      return 0;
+    }
+  }  
+  if (!PyTuple_Check(args)) {
+    PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
+    return 0;
+  } else {
+    register int l = PyTuple_GET_SIZE(args);
+    if (l < min) {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
+		   name, (min == max ? "" : "at least "), min, l);
+      return 0;
+    } else if (l > max) {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
+		   name, (min == max ? "" : "at most "), max, l);
+      return 0;
+    } else {
+      register int i;
+      for (i = 0; i < l; ++i) {
+	objs[i] = PyTuple_GET_ITEM(args, i);
+      }
+      for (; l < max; ++l) {
+	objs[l] = 0;
+      }
+      return i + 1;
+    }    
+  }
+}
+
+/* A functor is a function object with one single object argument */
+#if PY_VERSION_HEX >= 0x02020000
+#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
+#else
+#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunction(functor, "O", obj);
+#endif
+
+/*
+  Helper for static pointer initialization for both C and C++ code, for example
+  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
+*/
+#ifdef __cplusplus
+#define SWIG_STATIC_POINTER(var)  var
+#else
+#define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Pointer declarations
+ * ----------------------------------------------------------------------------- */
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
+#define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
+
+#define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* cc-mode */
+#endif
+#endif
+
+/*  How to access Py_None */
+#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#  ifndef SWIG_PYTHON_NO_BUILD_NONE
+#    ifndef SWIG_PYTHON_BUILD_NONE
+#      define SWIG_PYTHON_BUILD_NONE
+#    endif
+#  endif
+#endif
+
+#ifdef SWIG_PYTHON_BUILD_NONE
+#  ifdef Py_None
+#   undef Py_None
+#   define Py_None SWIG_Py_None()
+#  endif
+SWIGRUNTIMEINLINE PyObject * 
+_SWIG_Py_None(void)
+{
+  PyObject *none = Py_BuildValue("");
+  Py_DECREF(none);
+  return none;
+}
+SWIGRUNTIME PyObject * 
+SWIG_Py_None(void)
+{
+  static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
+  return none;
+}
+#endif
+
+/* The python void return value */
+
+SWIGRUNTIMEINLINE PyObject * 
+SWIG_Py_Void(void)
+{
+  PyObject *none = Py_None;
+  Py_INCREF(none);
+  return none;
+}
+
+
+/* PySwigClientData */
+
+typedef struct {
+  PyObject *klass;
+  PyObject *newraw;
+  PyObject *newargs;
+  PyObject *destroy;
+  int delargs;
+  int implicitconv;
+} PySwigClientData;
+
+SWIGRUNTIMEINLINE int 
+SWIG_Python_CheckImplicit(swig_type_info *ty)
+{
+  PySwigClientData *data = (PySwigClientData *)ty->clientdata;
+  return data ? data->implicitconv : 0;
+}
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Python_ExceptionType(swig_type_info *desc) {
+  PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
+  PyObject *klass = data ? data->klass : 0;
+  return (klass ? klass : PyExc_RuntimeError);
+}
+
+
+SWIGRUNTIME PySwigClientData * 
+PySwigClientData_New(PyObject* obj)
+{
+  if (!obj) {
+    return 0;
+  } else {
+    PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));
+    /* the klass element */
+    data->klass = obj;
+    Py_INCREF(obj);
+    /* the newraw method and newargs arguments used to create a new raw instance */
+    if (PyClass_Check(obj)) {
+      data->newraw = 0;
+      data->newargs = obj;
+      Py_INCREF(obj);
+    } else {
+#if (PY_VERSION_HEX < 0x02020000)
+      data->newraw = 0;
+      data->newargs = obj;
+      Py_INCREF(obj);
+#else
+      data->newraw = PyObject_GetAttrString((PyObject*)&PyBaseObject_Type, (char *)"__new__");
+      Py_INCREF(data->newraw);
+      data->newargs = PyTuple_New(1);
+      PyTuple_SetItem(data->newargs, 0, obj);
+      Py_INCREF(data->newargs);
+#endif
+    }
+    /* the destroy method, aka as the C++ delete method */
+    data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
+    if (PyErr_Occurred()) {
+      PyErr_Clear();
+      data->destroy = 0;
+    }
+    if (data->destroy) {
+      int flags;
+      Py_INCREF(data->destroy);
+      flags = PyCFunction_GET_FLAGS(data->destroy);
+#ifdef METH_O
+      data->delargs = !(flags & (METH_O));
+#else
+      data->delargs = 0;
+#endif
+    } else {
+      data->delargs = 0;
+    }
+    data->implicitconv = 0;
+    return data;
+  }
+}
+
+SWIGRUNTIME void 
+PySwigClientData_Del(PySwigClientData* data)
+{
+  Py_XDECREF(data->klass);
+  Py_XDECREF(data->newraw);
+  Py_XDECREF(data->newargs);
+  Py_XDECREF(data->destroy);
+}
+
+/* =============== PySwigObject =====================*/
+
+typedef struct {
+  PyObject_HEAD
+  void *ptr;
+  swig_type_info *ty;
+  int own;
+  PyObject *next;
+} PySwigObject;
+
+SWIGRUNTIME PyObject *
+PySwigObject_long(PySwigObject *v)
+{
+  return PyLong_FromVoidPtr(v->ptr);
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_format(const char* fmt, PySwigObject *v)
+{
+  PyObject *res = NULL;
+  PyObject *args = PyTuple_New(1);
+  if (args) {
+    if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {
+      PyObject *ofmt = PyString_FromString(fmt);
+      if (ofmt) {
+	res = PyString_Format(ofmt,args);
+	Py_DECREF(ofmt);
+      }
+      Py_DECREF(args);
+    }
+  }
+  return res;
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_oct(PySwigObject *v)
+{
+  return PySwigObject_format("%o",v);
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_hex(PySwigObject *v)
+{
+  return PySwigObject_format("%x",v);
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_repr(PySwigObject *v)
+{
+  const char *name = SWIG_TypePrettyName(v->ty);
+  PyObject *hex = PySwigObject_hex(v);    
+  PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex));
+  Py_DECREF(hex);
+  if (v->next) {
+    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);
+    PyString_ConcatAndDel(&repr,nrep);
+  }
+  return repr;  
+}
+
+SWIGRUNTIME int
+PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+{
+  PyObject *repr = PySwigObject_repr(v);
+  if (repr) {
+    fputs(PyString_AsString(repr), fp);
+    Py_DECREF(repr);
+    return 0; 
+  } else {
+    return 1; 
+  }
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_str(PySwigObject *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
+    PyString_FromString(result) : 0;
+}
+
+SWIGRUNTIME int
+PySwigObject_compare(PySwigObject *v, PySwigObject *w)
+{
+  void *i = v->ptr;
+  void *j = w->ptr;
+  return (i < j) ? -1 : ((i > j) ? 1 : 0);
+}
+
+SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
+
+SWIGRUNTIME PyTypeObject*
+PySwigObject_type(void) {
+  static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
+  return type;
+}
+
+SWIGRUNTIMEINLINE int
+PySwigObject_Check(PyObject *op) {
+  return ((op)->ob_type == PySwigObject_type())
+    || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_New(void *ptr, swig_type_info *ty, int own);
+
+SWIGRUNTIME void
+PySwigObject_dealloc(PyObject *v)
+{
+  PySwigObject *sobj = (PySwigObject *) v;
+  PyObject *next = sobj->next;
+  if (sobj->own) {
+    swig_type_info *ty = sobj->ty;
+    PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
+    PyObject *destroy = data ? data->destroy : 0;
+    if (destroy) {
+      /* destroy is always a VARARGS method */
+      PyObject *res;
+      if (data->delargs) {
+	/* we need to create a temporal object to carry the destroy operation */
+	PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);
+	res = SWIG_Python_CallFunctor(destroy, tmp);
+	Py_DECREF(tmp);
+      } else {
+	PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
+	PyObject *mself = PyCFunction_GET_SELF(destroy);
+	res = ((*meth)(mself, v));
+      }
+      Py_XDECREF(res);
+    } else {
+      const char *name = SWIG_TypePrettyName(ty);
+#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
+      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
+#endif
+    }
+  } 
+  Py_XDECREF(next);
+  PyObject_DEL(v);
+}
+
+SWIGRUNTIME PyObject* 
+PySwigObject_append(PyObject* v, PyObject* next)
+{
+  PySwigObject *sobj = (PySwigObject *) v;
+#ifndef METH_O
+  PyObject *tmp = 0;
+  if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
+  next = tmp;
+#endif
+  if (!PySwigObject_Check(next)) {
+    return NULL;
+  }
+  sobj->next = next;
+  Py_INCREF(next);
+  return SWIG_Py_Void();
+}
+
+SWIGRUNTIME PyObject* 
+#ifdef METH_NOARGS
+PySwigObject_next(PyObject* v)
+#else
+PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  PySwigObject *sobj = (PySwigObject *) v;
+  if (sobj->next) {    
+    Py_INCREF(sobj->next);
+    return sobj->next;
+  } else {
+    return SWIG_Py_Void();
+  }
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+PySwigObject_disown(PyObject *v)
+#else
+PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  PySwigObject *sobj = (PySwigObject *)v;
+  sobj->own = 0;
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+PySwigObject_acquire(PyObject *v)
+#else
+PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  PySwigObject *sobj = (PySwigObject *)v;
+  sobj->own = SWIG_POINTER_OWN;
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+PySwigObject_own(PyObject *v, PyObject *args)
+{
+  PyObject *val = 0;
+#if (PY_VERSION_HEX < 0x02020000)
+  if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
+#else
+  if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) 
+#endif
+    {
+      return NULL;
+    } 
+  else
+    {
+      PySwigObject *sobj = (PySwigObject *)v;
+      PyObject *obj = sobj->own ? Py_True : Py_False;
+      if (val) {
+#ifdef METH_NOARGS
+	if (PyObject_IsTrue(val)) {
+	  PySwigObject_acquire(v);
+	} else {
+	  PySwigObject_disown(v);
+	}
+#else
+	if (PyObject_IsTrue(val)) {
+	  PySwigObject_acquire(v,args);
+	} else {
+	  PySwigObject_disown(v,args);
+	}
+#endif
+      } 
+      Py_INCREF(obj);
+      return obj;
+    }
+}
+
+#ifdef METH_O
+static PyMethodDef
+swigobject_methods[] = {
+  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_O,       (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
+  {0, 0, 0, 0}  
+};
+#else
+static PyMethodDef
+swigobject_methods[] = {
+  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
+  {0, 0, 0, 0}  
+};
+#endif
+
+#if PY_VERSION_HEX < 0x02020000
+SWIGINTERN PyObject *
+PySwigObject_getattr(PySwigObject *sobj,char *name)
+{
+  return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
+}
+#endif
+
+SWIGRUNTIME PyTypeObject*
+_PySwigObject_type(void) {
+  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
+  
+  static PyNumberMethods PySwigObject_as_number = {
+    (binaryfunc)0, /*nb_add*/
+    (binaryfunc)0, /*nb_subtract*/
+    (binaryfunc)0, /*nb_multiply*/
+    (binaryfunc)0, /*nb_divide*/
+    (binaryfunc)0, /*nb_remainder*/
+    (binaryfunc)0, /*nb_divmod*/
+    (ternaryfunc)0,/*nb_power*/
+    (unaryfunc)0,  /*nb_negative*/
+    (unaryfunc)0,  /*nb_positive*/
+    (unaryfunc)0,  /*nb_absolute*/
+    (inquiry)0,    /*nb_nonzero*/
+    0,		   /*nb_invert*/
+    0,		   /*nb_lshift*/
+    0,		   /*nb_rshift*/
+    0,		   /*nb_and*/
+    0,		   /*nb_xor*/
+    0,		   /*nb_or*/
+    (coercion)0,   /*nb_coerce*/
+    (unaryfunc)PySwigObject_long, /*nb_int*/
+    (unaryfunc)PySwigObject_long, /*nb_long*/
+    (unaryfunc)0,                 /*nb_float*/
+    (unaryfunc)PySwigObject_oct,  /*nb_oct*/
+    (unaryfunc)PySwigObject_hex,  /*nb_hex*/
+#if PY_VERSION_HEX >= 0x02020000
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ 
+#elif PY_VERSION_HEX >= 0x02000000
+    0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
+#endif
+  };
+
+  static PyTypeObject pyswigobject_type;  
+  static int type_init = 0;
+  if (!type_init) {
+    const PyTypeObject tmp
+      = {
+	PyObject_HEAD_INIT(NULL)
+	0,				    /* ob_size */
+	(char *)"PySwigObject",		    /* tp_name */
+	sizeof(PySwigObject),		    /* tp_basicsize */
+	0,			            /* tp_itemsize */
+	(destructor)PySwigObject_dealloc,   /* tp_dealloc */
+	(printfunc)PySwigObject_print,	    /* tp_print */
+#if PY_VERSION_HEX < 0x02020000
+	(getattrfunc)PySwigObject_getattr,  /* tp_getattr */ 
+#else
+	(getattrfunc)0,			    /* tp_getattr */ 
+#endif
+	(setattrfunc)0,			    /* tp_setattr */ 
+	(cmpfunc)PySwigObject_compare,	    /* tp_compare */ 
+	(reprfunc)PySwigObject_repr,	    /* tp_repr */    
+	&PySwigObject_as_number,	    /* tp_as_number */
+	0,				    /* tp_as_sequence */
+	0,				    /* tp_as_mapping */
+	(hashfunc)0,			    /* tp_hash */
+	(ternaryfunc)0,			    /* tp_call */
+	(reprfunc)PySwigObject_str,	    /* tp_str */
+	PyObject_GenericGetAttr,            /* tp_getattro */
+	0,				    /* tp_setattro */
+	0,		                    /* tp_as_buffer */
+	Py_TPFLAGS_DEFAULT,	            /* tp_flags */
+	swigobject_doc, 	            /* tp_doc */        
+	0,                                  /* tp_traverse */
+	0,                                  /* tp_clear */
+	0,                                  /* tp_richcompare */
+	0,                                  /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+	0,                                  /* tp_iter */
+	0,                                  /* tp_iternext */
+	swigobject_methods,		    /* tp_methods */ 
+	0,			            /* tp_members */
+	0,				    /* tp_getset */	    	
+	0,			            /* tp_base */	        
+	0,				    /* tp_dict */	    	
+	0,				    /* tp_descr_get */  	
+	0,				    /* tp_descr_set */  	
+	0,				    /* tp_dictoffset */ 	
+	0,				    /* tp_init */	    	
+	0,				    /* tp_alloc */	    	
+	0,			            /* tp_new */	    	
+	0,	                            /* tp_free */	   
+        0,                                  /* tp_is_gc */  
+	0,				    /* tp_bases */   
+	0,				    /* tp_mro */
+	0,				    /* tp_cache */   
+ 	0,				    /* tp_subclasses */
+	0,				    /* tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+	0,                                  /* tp_del */
+#endif
+#ifdef COUNT_ALLOCS
+	0,0,0,0                             /* tp_alloc -> tp_next */
+#endif
+      };
+    pyswigobject_type = tmp;
+    pyswigobject_type.ob_type = &PyType_Type;
+    type_init = 1;
+  }
+  return &pyswigobject_type;
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_New(void *ptr, swig_type_info *ty, int own)
+{
+  PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());
+  if (sobj) {
+    sobj->ptr  = ptr;
+    sobj->ty   = ty;
+    sobj->own  = own;
+    sobj->next = 0;
+  }
+  return (PyObject *)sobj;
+}
+
+/* -----------------------------------------------------------------------------
+ * Implements a simple Swig Packed type, and use it instead of string
+ * ----------------------------------------------------------------------------- */
+
+typedef struct {
+  PyObject_HEAD
+  void *pack;
+  swig_type_info *ty;
+  size_t size;
+} PySwigPacked;
+
+SWIGRUNTIME int
+PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+{
+  char result[SWIG_BUFFER_SIZE];
+  fputs("<Swig Packed ", fp); 
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
+    fputs("at ", fp); 
+    fputs(result, fp); 
+  }
+  fputs(v->ty->name,fp); 
+  fputs(">", fp);
+  return 0; 
+}
+  
+SWIGRUNTIME PyObject *
+PySwigPacked_repr(PySwigPacked *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
+    return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
+  } else {
+    return PyString_FromFormat("<Swig Packed %s>", v->ty->name);
+  }  
+}
+
+SWIGRUNTIME PyObject *
+PySwigPacked_str(PySwigPacked *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
+    return PyString_FromFormat("%s%s", result, v->ty->name);
+  } else {
+    return PyString_FromString(v->ty->name);
+  }  
+}
+
+SWIGRUNTIME int
+PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
+{
+  size_t i = v->size;
+  size_t j = w->size;
+  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
+  return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
+}
+
+SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
+
+SWIGRUNTIME PyTypeObject*
+PySwigPacked_type(void) {
+  static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
+  return type;
+}
+
+SWIGRUNTIMEINLINE int
+PySwigPacked_Check(PyObject *op) {
+  return ((op)->ob_type == _PySwigPacked_type()) 
+    || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
+}
+
+SWIGRUNTIME void
+PySwigPacked_dealloc(PyObject *v)
+{
+  if (PySwigPacked_Check(v)) {
+    PySwigPacked *sobj = (PySwigPacked *) v;
+    free(sobj->pack);
+  }
+  PyObject_DEL(v);
+}
+
+SWIGRUNTIME PyTypeObject*
+_PySwigPacked_type(void) {
+  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
+  static PyTypeObject pyswigpacked_type;
+  static int type_init = 0;  
+  if (!type_init) {
+    const PyTypeObject tmp
+      = {
+	PyObject_HEAD_INIT(NULL)
+	0,				    /* ob_size */	
+	(char *)"PySwigPacked",		    /* tp_name */	
+	sizeof(PySwigPacked),		    /* tp_basicsize */	
+	0,				    /* tp_itemsize */	
+	(destructor)PySwigPacked_dealloc,   /* tp_dealloc */	
+	(printfunc)PySwigPacked_print,	    /* tp_print */   	
+	(getattrfunc)0,			    /* tp_getattr */ 	
+	(setattrfunc)0,			    /* tp_setattr */ 	
+	(cmpfunc)PySwigPacked_compare,	    /* tp_compare */ 	
+	(reprfunc)PySwigPacked_repr,	    /* tp_repr */    	
+	0,	                            /* tp_as_number */	
+	0,				    /* tp_as_sequence */
+	0,				    /* tp_as_mapping */	
+	(hashfunc)0,			    /* tp_hash */	
+	(ternaryfunc)0,			    /* tp_call */	
+	(reprfunc)PySwigPacked_str,	    /* tp_str */	
+	PyObject_GenericGetAttr,            /* tp_getattro */
+	0,				    /* tp_setattro */
+	0,		                    /* tp_as_buffer */
+	Py_TPFLAGS_DEFAULT,	            /* tp_flags */
+	swigpacked_doc, 	            /* tp_doc */
+	0,                                  /* tp_traverse */
+	0,                                  /* tp_clear */
+	0,                                  /* tp_richcompare */
+	0,                                  /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+	0,                                  /* tp_iter */
+	0,                                  /* tp_iternext */
+	0,		                    /* tp_methods */ 
+	0,			            /* tp_members */
+	0,				    /* tp_getset */	    	
+	0,			            /* tp_base */	        
+	0,				    /* tp_dict */	    	
+	0,				    /* tp_descr_get */  	
+	0,				    /* tp_descr_set */  	
+	0,				    /* tp_dictoffset */ 	
+	0,				    /* tp_init */	    	
+	0,				    /* tp_alloc */	    	
+	0,			            /* tp_new */	    	
+	0, 	                            /* tp_free */	   
+        0,                                  /* tp_is_gc */  
+	0,				    /* tp_bases */   
+	0,				    /* tp_mro */
+	0,				    /* tp_cache */   
+ 	0,				    /* tp_subclasses */
+	0,				    /* tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+	0,                                  /* tp_del */
+#endif
+#ifdef COUNT_ALLOCS
+	0,0,0,0                             /* tp_alloc -> tp_next */
+#endif
+      };
+    pyswigpacked_type = tmp;
+    pyswigpacked_type.ob_type = &PyType_Type;
+    type_init = 1;
+  }
+  return &pyswigpacked_type;
+}
+
+SWIGRUNTIME PyObject *
+PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
+{
+  PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());
+  if (sobj) {
+    void *pack = malloc(size);
+    if (pack) {
+      memcpy(pack, ptr, size);
+      sobj->pack = pack;
+      sobj->ty   = ty;
+      sobj->size = size;
+    } else {
+      PyObject_DEL((PyObject *) sobj);
+      sobj = 0;
+    }
+  }
+  return (PyObject *) sobj;
+}
+
+SWIGRUNTIME swig_type_info *
+PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
+{
+  if (PySwigPacked_Check(obj)) {
+    PySwigPacked *sobj = (PySwigPacked *)obj;
+    if (sobj->size != size) return 0;
+    memcpy(ptr, sobj->pack, size);
+    return sobj->ty;
+  } else {
+    return 0;
+  }
+}
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGRUNTIMEINLINE PyObject *
+_SWIG_This(void)
+{
+  return PyString_FromString("this");
+}
+
+SWIGRUNTIME PyObject *
+SWIG_This(void)
+{
+  static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
+  return swig_this;
+}
+
+/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
+
+SWIGRUNTIME PySwigObject *
+SWIG_Python_GetSwigThis(PyObject *pyobj) 
+{
+  if (PySwigObject_Check(pyobj)) {
+    return (PySwigObject *) pyobj;
+  } else {
+    PyObject *obj = 0;
+#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
+    if (PyInstance_Check(pyobj)) {
+      obj = _PyInstance_Lookup(pyobj, SWIG_This());      
+    } else {
+      PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
+      if (dictptr != NULL) {
+	PyObject *dict = *dictptr;
+	obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
+      }      
+#ifdef PyWeakref_CheckProxy
+      else if (PyWeakref_CheckProxy(pyobj)) {
+	PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
+	return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
+      }
+#endif
+      if (!obj) {
+	obj = PyObject_GetAttr(pyobj,SWIG_This());
+	if (obj) {
+	  Py_DECREF(obj);
+	} else {
+	  if (PyErr_Occurred()) PyErr_Clear();
+	  return 0;
+	}
+      }
+    }
+#else
+    obj = PyObject_GetAttr(pyobj,SWIG_This());
+    if (obj) {
+      Py_DECREF(obj);
+    } else {
+      if (PyErr_Occurred()) PyErr_Clear();
+      return 0;
+    }
+#endif
+    if (obj && !PySwigObject_Check(obj)) {
+      /* a PyObject is called 'this', try to get the 'real this'
+	 PySwigObject from it */ 
+      return SWIG_Python_GetSwigThis(obj);
+    }
+    return (PySwigObject *)obj;
+  }
+}
+
+
+/* Acquire a pointer value */
+
+SWIGRUNTIME int
+SWIG_Python_AcquirePtr(PyObject *obj, int own) {
+  if (own) {
+    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+    if (sobj) {
+      int oldown = sobj->own;
+      sobj->own = own;
+      return oldown;
+    }
+  }
+  return 0;
+}
+
+/* Convert a pointer value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
+  if (!obj) return SWIG_ERROR;
+  if (obj == Py_None) {
+    if (ptr) *ptr = 0;
+    return SWIG_OK;
+  } else {
+    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+    while (sobj) {
+      void *vptr = sobj->ptr;
+      if (ty) {
+	swig_type_info *to = sobj->ty;
+	if (to == ty) {
+	  /* no type cast needed */
+	  if (ptr) *ptr = vptr;
+	  break;
+	} else {
+	  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+	  if (!tc) {
+	    sobj = (PySwigObject *)sobj->next;
+	  } else {
+	    if (ptr) *ptr = SWIG_TypeCast(tc,vptr);
+	    break;
+	  }
+	}
+      } else {
+	if (ptr) *ptr = vptr;
+	break;
+      }
+    }
+    if (sobj) {
+      if (own) *own = sobj->own;
+      if (flags & SWIG_POINTER_DISOWN) {
+	sobj->own = 0;
+      }
+      return SWIG_OK;
+    } else {
+      int res = SWIG_ERROR;
+      if (flags & SWIG_POINTER_IMPLICIT_CONV) {
+	PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
+	if (data && !data->implicitconv) {
+	  PyObject *klass = data->klass;
+	  if (klass) {
+	    PyObject *impconv;
+	    data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
+	    impconv = SWIG_Python_CallFunctor(klass, obj);
+	    data->implicitconv = 0;
+	    if (PyErr_Occurred()) {
+	      PyErr_Clear();
+	      impconv = 0;
+	    }
+	    if (impconv) {
+	      PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);
+	      if (iobj) {
+		void *vptr;
+		res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
+		if (SWIG_IsOK(res)) {
+		  if (ptr) {
+		    *ptr = vptr;
+		    /* transfer the ownership to 'ptr' */
+		    iobj->own = 0;
+		    res = SWIG_AddCast(res);
+		    res = SWIG_AddNewMask(res);
+		  } else {
+		    res = SWIG_AddCast(res);		    
+		  }
+		}
+	      }
+	      Py_DECREF(impconv);
+	    }
+	  }
+	}
+      }
+      return res;
+    }
+  }
+}
+
+/* Convert a function ptr value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
+  if (!PyCFunction_Check(obj)) {
+    return SWIG_ConvertPtr(obj, ptr, ty, 0);
+  } else {
+    void *vptr = 0;
+    
+    /* here we get the method pointer for callbacks */
+    char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
+    const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
+    if (desc) {
+      desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
+      if (!desc) return SWIG_ERROR;
+    }
+    if (ty) {
+      swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
+      if (!tc) return SWIG_ERROR;
+      *ptr = SWIG_TypeCast(tc,vptr);
+    } else {
+      *ptr = vptr;
+    }
+    return SWIG_OK;
+  }
+}
+
+/* Convert a packed value value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
+  swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz);
+  if (!to) return SWIG_ERROR;
+  if (ty) {
+    if (to != ty) {
+      /* check type cast? */
+      swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+      if (!tc) return SWIG_ERROR;
+    }
+  }
+  return SWIG_OK;
+}  
+
+/* -----------------------------------------------------------------------------
+ * Create a new pointer object
+ * ----------------------------------------------------------------------------- */
+
+/*
+  Create a new instance object, whitout calling __init__, and set the
+  'this' attribute.
+*/
+
+SWIGRUNTIME PyObject* 
+SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
+{
+#if (PY_VERSION_HEX >= 0x02020000)
+  PyObject *inst = 0;
+  PyObject *newraw = data->newraw;
+  if (newraw) {
+    inst = PyObject_Call(newraw, data->newargs, NULL);
+    if (inst) {
+#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
+      PyObject **dictptr = _PyObject_GetDictPtr(inst);
+      if (dictptr != NULL) {
+	PyObject *dict = *dictptr;
+	if (dict == NULL) {
+	  dict = PyDict_New();
+	  *dictptr = dict;
+	  PyDict_SetItem(dict, SWIG_This(), swig_this);
+	}
+      }
+#else
+      PyObject *key = SWIG_This();
+      PyObject_SetAttr(inst, key, swig_this);
+#endif
+    }
+  } else {
+    PyObject *dict = PyDict_New();
+    PyDict_SetItem(dict, SWIG_This(), swig_this);
+    inst = PyInstance_NewRaw(data->newargs, dict);
+    Py_DECREF(dict);
+  }
+  return inst;
+#else
+  PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
+  if (inst == NULL) {
+    return NULL;
+  }
+  inst->in_class = (PyClassObject *)data->newargs;
+  Py_INCREF(inst->in_class);
+  inst->in_dict = PyDict_New();
+  if (inst->in_dict == NULL) {
+    Py_DECREF(inst);
+    return NULL;
+  }
+  PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
+  return (PyObject *) inst;
+#endif
+}
+
+/* Create a new pointer object */
+
+SWIGRUNTIME PyObject *
+SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
+  if (!ptr) {
+    return SWIG_Py_Void();
+  } else {
+    int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
+    PyObject *robj = PySwigObject_New(ptr, type, own);
+    PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0;
+    if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
+      PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
+      if (inst) {
+	Py_DECREF(robj);
+	robj = inst;
+      }
+    }
+    return robj;
+  }
+}
+
+/* Create a new packed object */
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
+  return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
+}
+
+/* -----------------------------------------------------------------------------*
+ *  Get type list 
+ * -----------------------------------------------------------------------------*/
+
+#ifdef SWIG_LINK_RUNTIME
+void *SWIG_ReturnGlobalTypeList(void *);
+#endif
+
+SWIGRUNTIME swig_module_info *
+SWIG_Python_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  /* first check if module already created */
+  if (!type_pointer) {
+#ifdef SWIG_LINK_RUNTIME
+    type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
+#else
+    type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+				    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
+    if (PyErr_Occurred()) {
+      PyErr_Clear();
+      type_pointer = (void *)0;
+    }
+#endif
+  }
+  return (swig_module_info *) type_pointer;
+}
+
+#if PY_MAJOR_VERSION < 2
+/* PyModule_AddObject function was introduced in Python 2.0.  The following function
+   is copied out of Python/modsupport.c in python version 2.3.4 */
+SWIGINTERN int
+PyModule_AddObject(PyObject *m, char *name, PyObject *o)
+{
+  PyObject *dict;
+  if (!PyModule_Check(m)) {
+    PyErr_SetString(PyExc_TypeError,
+		    "PyModule_AddObject() needs module as first arg");
+    return SWIG_ERROR;
+  }
+  if (!o) {
+    PyErr_SetString(PyExc_TypeError,
+		    "PyModule_AddObject() needs non-NULL value");
+    return SWIG_ERROR;
+  }
+  
+  dict = PyModule_GetDict(m);
+  if (dict == NULL) {
+    /* Internal error -- modules must have a dict! */
+    PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
+		 PyModule_GetName(m));
+    return SWIG_ERROR;
+  }
+  if (PyDict_SetItemString(dict, name, o))
+    return SWIG_ERROR;
+  Py_DECREF(o);
+  return SWIG_OK;
+}
+#endif
+
+SWIGRUNTIME void
+SWIG_Python_DestroyModule(void *vptr)
+{
+  swig_module_info *swig_module = (swig_module_info *) vptr;
+  swig_type_info **types = swig_module->types;
+  size_t i;
+  for (i =0; i < swig_module->size; ++i) {
+    swig_type_info *ty = types[i];
+    if (ty->owndata) {
+      PySwigClientData *data = (PySwigClientData *) ty->clientdata;
+      if (data) PySwigClientData_Del(data);
+    }
+  }
+  Py_DECREF(SWIG_This());
+}
+
+SWIGRUNTIME void
+SWIG_Python_SetModule(swig_module_info *swig_module) {
+  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
+
+  PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+				   swig_empty_runtime_method_table);
+  PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
+  if (pointer && module) {
+    PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+  } else {
+    Py_XDECREF(pointer);
+  }
+}
+
+
+/* 
+   For backward compatibility only
+*/
+#define SWIG_POINTER_EXCEPTION  0
+#define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
+#define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
+
+SWIGRUNTIME int
+SWIG_Python_AddErrMesg(const char* mesg, int infront)
+{
+  if (PyErr_Occurred()) {
+    PyObject *type = 0;
+    PyObject *value = 0;
+    PyObject *traceback = 0;
+    PyErr_Fetch(&type, &value, &traceback);
+    if (value) {
+      PyObject *old_str = PyObject_Str(value);
+      Py_XINCREF(type);
+      PyErr_Clear();
+      if (infront) {
+	PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
+      } else {
+	PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+      }
+      Py_DECREF(old_str);
+    }
+    return 1;
+  } else {
+    return 0;
+  }
+}
+  
+SWIGRUNTIME int
+SWIG_Python_ArgFail(int argnum)
+{
+  if (PyErr_Occurred()) {
+    /* add information about failing argument */
+    char mesg[256];
+    PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
+    return SWIG_Python_AddErrMesg(mesg, 1);
+  } else {
+    return 0;
+  }
+}
+
+SWIGRUNTIMEINLINE const char *
+PySwigObject_GetDesc(PyObject *self)
+{
+  PySwigObject *v = (PySwigObject *)self;
+  swig_type_info *ty = v ? v->ty : 0;
+  return ty ? ty->str : (char*)"";
+}
+
+SWIGRUNTIME void
+SWIG_Python_TypeError(const char *type, PyObject *obj)
+{
+  if (type) {
+#if defined(SWIG_COBJECT_TYPES)
+    if (obj && PySwigObject_Check(obj)) {
+      const char *otype = (const char *) PySwigObject_GetDesc(obj);
+      if (otype) {
+	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
+		     type, otype);
+	return;
+      }
+    } else 
+#endif      
+    {
+      const char *otype = (obj ? obj->ob_type->tp_name : 0); 
+      if (otype) {
+	PyObject *str = PyObject_Str(obj);
+	const char *cstr = str ? PyString_AsString(str) : 0;
+	if (cstr) {
+	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
+		       type, otype, cstr);
+	} else {
+	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
+		       type, otype);
+	}
+	Py_XDECREF(str);
+	return;
+      }
+    }   
+    PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
+  } else {
+    PyErr_Format(PyExc_TypeError, "unexpected type is received");
+  }
+}
+
+
+/* Convert a pointer value, signal an exception on a type mismatch */
+SWIGRUNTIME void *
+SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
+  void *result;
+  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
+    PyErr_Clear();
+    if (flags & SWIG_POINTER_EXCEPTION) {
+      SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
+      SWIG_Python_ArgFail(argnum);
+    }
+  }
+  return result;
+}
+
+
+#ifdef __cplusplus
+#if 0
+{ /* cc-mode */
+#endif
+}
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_char swig_types[0]
+#define SWIGTYPE_p_npy_clongdouble swig_types[1]
+#define SWIGTYPE_p_std__vectorTdouble_t swig_types[2]
+#define SWIGTYPE_p_std__vectorTfloat_t swig_types[3]
+#define SWIGTYPE_p_std__vectorTint_t swig_types[4]
+#define SWIGTYPE_p_std__vectorTlong_double_t swig_types[5]
+#define SWIGTYPE_p_std__vectorTnpy_cdouble_t swig_types[6]
+#define SWIGTYPE_p_std__vectorTnpy_cfloat_t swig_types[7]
+#define SWIGTYPE_p_std__vectorTnpy_clongdouble_t swig_types[8]
+static swig_type_info *swig_types[10];
+static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#if (PY_VERSION_HEX <= 0x02000000)
+# if !defined(SWIG_PYTHON_CLASSIC)
+#  warning "This python version probably requires to use swig with the '-classic' option"
+# endif
+#endif
+
+/*-----------------------------------------------
+              @(target):= _sparsetools.so
+  ------------------------------------------------*/
+#define SWIG_init    init_sparsetools
+
+#define SWIG_name    "_sparsetools"
+
+#define SWIGVERSION 0x010328 
+
+
+#define SWIG_as_voidptr(a) const_cast<void * >(static_cast<const void * >(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast<void** >(a)) 
+
+
+#include <stdexcept>
+
+
+namespace swig {
+  class PyObject_ptr {
+  protected:
+    PyObject *_obj;
+
+  public:
+    PyObject_ptr() :_obj(0)
+    {
+    }
+
+    PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj)
+    {
+      Py_XINCREF(_obj);      
+    }
+    
+    PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj)
+    {
+      if (initial_ref) Py_XINCREF(_obj);
+    }
+    
+    PyObject_ptr & operator=(const PyObject_ptr& item) 
+    {
+      Py_XINCREF(item._obj);
+      Py_XDECREF(_obj);
+      _obj = item._obj;
+      return *this;      
+    }
+    
+    ~PyObject_ptr() 
+    {
+      Py_XDECREF(_obj);
+    }
+    
+    operator PyObject *() const
+    {
+      return _obj;
+    }
+
+    PyObject *operator->() const
+    {
+      return _obj;
+    }
+  };
+}
+
+
+namespace swig {
+  struct PyObject_var : PyObject_ptr {
+    PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { }
+    
+    PyObject_var & operator = (PyObject* obj)
+    {
+      Py_XDECREF(_obj);
+      _obj = obj;
+      return *this;      
+    }
+  };
+}
+
+
+#define SWIG_FILE_WITH_INIT
+#include "numpy/arrayobject.h"
+#include "complex_ops.h"
+#include "sparsetools.h"
+
+
+#ifndef SWIG_FILE_WITH_INIT
+#  define NO_IMPORT_ARRAY
+#endif
+#include "stdio.h"
+#include <numpy/arrayobject.h>
+
+/* The following code originally appeared in enthought/kiva/agg/src/numeric.i,
+ * author unknown.  It was translated from C++ to C by John Hunter.  Bill
+ * Spotz has modified it slightly to fix some minor bugs, add some comments
+ * and some functionality.
+ */
+
+/* Macros to extract array attributes.
+ */
+#define is_array(a)            ((a) && PyArray_Check((PyArrayObject *)a))
+#define array_type(a)          (int)(PyArray_TYPE(a))
+#define array_dimensions(a)    (((PyArrayObject *)a)->nd)
+#define array_size(a,i)        (((PyArrayObject *)a)->dimensions[i])
+#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS(a))
+
+/* Given a PyObject, return a string describing its type.
+ */
+char* pytype_string(PyObject* py_obj) {
+  if (py_obj == NULL          ) return "C NULL value";
+  if (PyCallable_Check(py_obj)) return "callable"    ;
+  if (PyString_Check(  py_obj)) return "string"      ;
+  if (PyInt_Check(     py_obj)) return "int"         ;
+  if (PyFloat_Check(   py_obj)) return "float"       ;
+  if (PyDict_Check(    py_obj)) return "dict"        ;
+  if (PyList_Check(    py_obj)) return "list"        ;
+  if (PyTuple_Check(   py_obj)) return "tuple"       ;
+  if (PyFile_Check(    py_obj)) return "file"        ;
+  if (PyModule_Check(  py_obj)) return "module"      ;
+  if (PyInstance_Check(py_obj)) return "instance"    ;
+
+  return "unkown type";
+}
+
+/* Given a Numeric typecode, return a string describing the type.
+ */
+char* typecode_string(int typecode) {
+  char* type_names[20] = {"char","unsigned byte","byte","short",
+			  "unsigned short","int","unsigned int","long",
+			  "float","double","complex float","complex double",
+			  "object","ntype","unkown"};
+  return type_names[typecode];
+}
+
+/* Make sure input has correct numeric type.  Allow character and byte
+ * to match.  Also allow int and long to match.
+ */
+int type_match(int actual_type, int desired_type) {
+  return PyArray_EquivTypenums(actual_type, desired_type);
+}
+
+/* Given a PyObject pointer, cast it to a PyArrayObject pointer if
+ * legal.  If not, set the python error string appropriately and
+ * return NULL./
+ */
+PyArrayObject* obj_to_array_no_conversion(PyObject* input, int typecode) {
+  PyArrayObject* ary = NULL;
+  if (is_array(input) && (typecode == PyArray_NOTYPE || 
+			  PyArray_EquivTypenums(array_type(input), 
+						typecode))) {
+        ary = (PyArrayObject*) input;
+    }
+    else if is_array(input) {
+      char* desired_type = typecode_string(typecode);
+      char* actual_type = typecode_string(array_type(input));
+      PyErr_Format(PyExc_TypeError, 
+		   "Array of type '%s' required.  Array of type '%s' given", 
+		   desired_type, actual_type);
+      ary = NULL;
+    }
+    else {
+      char * desired_type = typecode_string(typecode);
+      char * actual_type = pytype_string(input);
+      PyErr_Format(PyExc_TypeError, 
+		   "Array of type '%s' required.  A %s was given", 
+		   desired_type, actual_type);
+      ary = NULL;
+    }
+  return ary;
+}
+
+/* Convert the given PyObject to a Numeric array with the given
+ * typecode.  On Success, return a valid PyArrayObject* with the
+ * correct type.  On failure, the python error string will be set and
+ * the routine returns NULL.
+ */
+PyArrayObject* obj_to_array_allow_conversion(PyObject* input, int typecode,
+                                             int* is_new_object)
+{
+  PyArrayObject* ary = NULL;
+  PyObject* py_obj;
+  if (is_array(input) && (typecode == PyArray_NOTYPE || type_match(array_type(input),typecode))) {
+    ary = (PyArrayObject*) input;
+    *is_new_object = 0;
+  }
+  else {
+    py_obj = PyArray_FromObject(input, typecode, 0, 0);
+    /* If NULL, PyArray_FromObject will have set python error value.*/
+    ary = (PyArrayObject*) py_obj;
+    *is_new_object = 1;
+  }
+  return ary;
+}
+
+/* Given a PyArrayObject, check to see if it is contiguous.  If so,
+ * return the input pointer and flag it as not a new object.  If it is
+ * not contiguous, create a new PyArrayObject using the original data,
+ * flag it as a new object and return the pointer.
+ */
+PyArrayObject* make_contiguous(PyArrayObject* ary, int* is_new_object,
+                               int min_dims, int max_dims)
+{
+  PyArrayObject* result;
+  if (array_is_contiguous(ary)) {
+    result = ary;
+    *is_new_object = 0;
+  }
+  else {
+    result = (PyArrayObject*) PyArray_ContiguousFromObject((PyObject*)ary, 
+							   array_type(ary), 
+							   min_dims,
+							   max_dims);
+    *is_new_object = 1;
+  }
+  return result;
+}
+
+/* Convert a given PyObject to a contiguous PyArrayObject of the
+ * specified type.  If the input object is not a contiguous
+ * PyArrayObject, a new one will be created and the new object flag
+ * will be set.
+ */
+PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject* input,
+                                                        int typecode,
+                                                        int* is_new_object) {
+  int is_new1 = 0;
+  int is_new2 = 0;
+  PyArrayObject* ary2;
+  PyArrayObject* ary1 = obj_to_array_allow_conversion(input, typecode, 
+						      &is_new1);
+  if (ary1) {
+    ary2 = make_contiguous(ary1, &is_new2, 0, 0);
+    if ( is_new1 && is_new2) {
+      Py_DECREF(ary1);
+    }
+    ary1 = ary2;    
+  }
+  *is_new_object = is_new1 || is_new2;
+  return ary1;
+}
+
+/* Test whether a python object is contiguous.  If array is
+ * contiguous, return 1.  Otherwise, set the python error string and
+ * return 0.
+ */
+int require_contiguous(PyArrayObject* ary) {
+  int contiguous = 1;
+  if (!array_is_contiguous(ary)) {
+    PyErr_SetString(PyExc_TypeError, "Array must be contiguous.  A discontiguous array was given");
+    contiguous = 0;
+  }
+  return contiguous;
+}
+
+/* Require the given PyArrayObject to have a specified number of
+ * dimensions.  If the array has the specified number of dimensions,
+ * return 1.  Otherwise, set the python error string and return 0.
+ */
+int require_dimensions(PyArrayObject* ary, int exact_dimensions) {
+  int success = 1;
+  if (array_dimensions(ary) != exact_dimensions) {
+    PyErr_Format(PyExc_TypeError, 
+		 "Array must be have %d dimensions.  Given array has %d dimensions", 
+		 exact_dimensions, array_dimensions(ary));
+    success = 0;
+  }
+  return success;
+}
+
+/* Require the given PyArrayObject to have one of a list of specified
+ * number of dimensions.  If the array has one of the specified number
+ * of dimensions, return 1.  Otherwise, set the python error string
+ * and return 0.
+ */
+int require_dimensions_n(PyArrayObject* ary, int* exact_dimensions, int n) {
+  int success = 0;
+  int i;
+  char dims_str[255] = "";
+  char s[255];
+  for (i = 0; i < n && !success; i++) {
+    if (array_dimensions(ary) == exact_dimensions[i]) {
+      success = 1;
+    }
+  }
+  if (!success) {
+    for (i = 0; i < n-1; i++) {
+      sprintf(s, "%d, ", exact_dimensions[i]);                
+      strcat(dims_str,s);
+    }
+    sprintf(s, " or %d", exact_dimensions[n-1]);            
+    strcat(dims_str,s);
+    PyErr_Format(PyExc_TypeError, 
+		 "Array must be have %s dimensions.  Given array has %d dimensions",
+		 dims_str, array_dimensions(ary));
+  }
+  return success;
+}    
+
+/* Require the given PyArrayObject to have a specified shape.  If the
+ * array has the specified shape, return 1.  Otherwise, set the python
+ * error string and return 0.
+ */
+int require_size(PyArrayObject* ary, int* size, int n) {
+  int i;
+  int success = 1;
+  int len;
+  char desired_dims[255] = "[";
+  char s[255];
+  char actual_dims[255] = "[";
+  for(i=0; i < n;i++) {
+    if (size[i] != -1 &&  size[i] != array_size(ary,i)) {
+      success = 0;    
+    }
+  }
+  if (!success) {
+    for (i = 0; i < n; i++) {
+      if (size[i] == -1) {
+	sprintf(s, "*,");                
+      }
+      else
+      {
+	sprintf(s, "%d,", size[i]);                
+      }    
+      strcat(desired_dims,s);
+    }
+    len = strlen(desired_dims);
+    desired_dims[len-1] = ']';
+    for (i = 0; i < n; i++) {
+      sprintf(s, "%d,", array_size(ary,i));                            
+      strcat(actual_dims,s);
+    }
+    len = strlen(actual_dims);
+    actual_dims[len-1] = ']';
+    PyErr_Format(PyExc_TypeError, 
+		 "Array must be have shape of %s.  Given array has shape of %s",
+		 desired_dims, actual_dims);
+  }
+  return success;
+}
+/* End John Hunter translation (with modifications by Bill Spotz) */
+
+
+
+/*!
+  Appends @a what to @a where. On input, @a where need not to be a tuple, but on
+  return it always is.
+
+  @par Revision history:
+  - 17.02.2005, c
+*/
+PyObject *helper_appendToTuple( PyObject *where, PyObject *what ) {
+  PyObject *o2, *o3;
+
+  if ((!where) || (where == Py_None)) {
+    where = what;
+  } else {
+    if (!PyTuple_Check( where )) {
+      o2 = where;
+      where = PyTuple_New( 1 );
+      PyTuple_SetItem( where, 0, o2 );
+    }
+    o3 = PyTuple_New( 1 );
+    PyTuple_SetItem( o3, 0, what );
+    o2 = where;
+    where = PySequence_Concat( o2, o3 );
+    Py_DECREF( o2 );
+    Py_DECREF( o3 );
+  }
+  return where;
+}
+
+
+
+
+
+
+#include <limits.h>
+#ifndef LLONG_MIN
+# define LLONG_MIN	LONG_LONG_MIN
+#endif
+#ifndef LLONG_MAX
+# define LLONG_MAX	LONG_LONG_MAX
+#endif
+#ifndef ULLONG_MAX
+# define ULLONG_MAX	ULONG_LONG_MAX
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_double (PyObject *obj, double *val)
+{
+  int res = SWIG_TypeError;
+  if (PyFloat_Check(obj)) {
+    if (val) *val = PyFloat_AsDouble(obj);
+    return SWIG_OK;
+  } else if (PyInt_Check(obj)) {
+    if (val) *val = PyInt_AsLong(obj);
+    return SWIG_OK;
+  } else if (PyLong_Check(obj)) {
+    double v = PyLong_AsDouble(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      PyErr_Clear();
+    }
+  }
+#ifdef SWIG_PYTHON_CAST_MODE
+  {
+    int dispatch = 0;
+    double d = PyFloat_AsDouble(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = d;
+      return SWIG_AddCast(SWIG_OK);
+    } else {
+      PyErr_Clear();
+    }
+    if (!dispatch) {
+      long v = PyLong_AsLong(obj);
+      if (!PyErr_Occurred()) {
+	if (val) *val = v;
+	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
+      } else {
+	PyErr_Clear();
+      }
+    }
+  }
+#endif
+  return res;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+  double x = *d;
+  if ((min <= x && x <= max)) {
+   double fx = floor(x);
+   double cx = ceil(x);
+   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+   if ((errno == EDOM) || (errno == ERANGE)) {
+     errno = 0;
+   } else {
+     double summ, reps, diff;
+     if (rd < x) {
+       diff = x - rd;
+     } else if (rd > x) {
+       diff = rd - x;
+     } else {
+       return 1;
+     }
+     summ = rd + x;
+     reps = diff/summ;
+     if (reps < 8*DBL_EPSILON) {
+       *d = rd;
+       return 1;
+     }
+   }
+  }
+  return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long (PyObject *obj, long* val)
+{
+  if (PyInt_Check(obj)) {
+    if (val) *val = PyInt_AsLong(obj);
+    return SWIG_OK;
+  } else if (PyLong_Check(obj)) {
+    long v = PyLong_AsLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      PyErr_Clear();
+    }
+  }
+#ifdef SWIG_PYTHON_CAST_MODE
+  {
+    int dispatch = 0;
+    long v = PyInt_AsLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_AddCast(SWIG_OK);
+    } else {
+      PyErr_Clear();
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+	if (val) *val = (long)(d);
+	return res;
+      }
+    }
+  }
+#endif
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_int (PyObject * obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long (obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = static_cast<int >(v);
+    }
+  }  
+  return res;
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+SWIGINTERN PyObject *_wrap_csrtocsc__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg8 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<float > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<float>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocsc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  csrtocsc<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(float)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocsc__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg8 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<double > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<double>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocsc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  csrtocsc<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(double)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocsc__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg8 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<long double > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<long double>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocsc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  csrtocsc<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(long double)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocsc__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg8 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_cfloat > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_cfloat>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocsc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  csrtocsc<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocsc__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg8 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_cdouble > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_cdouble>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocsc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  csrtocsc<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocsc__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg8 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_clongdouble > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_clongdouble>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocsc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  csrtocsc<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocsc(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[6];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocsc__SWIG_1(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocsc__SWIG_2(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocsc__SWIG_3(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocsc__SWIG_4(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocsc__SWIG_5(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocsc__SWIG_6(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'csrtocsc'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocsr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg8 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<float > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<float>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocsr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  csctocsr<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(float)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocsr__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg8 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<double > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<double>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocsr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  csctocsr<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(double)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocsr__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg8 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<long double > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<long double>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocsr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  csctocsr<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(long double)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocsr__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg8 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_cfloat > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_cfloat>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocsr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  csctocsr<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocsr__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg8 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_cdouble > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_cdouble>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocsr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  csctocsr<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocsr__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg8 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_clongdouble > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_clongdouble>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocsr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  csctocsr<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocsr(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[6];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocsr__SWIG_1(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocsr__SWIG_2(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocsr__SWIG_3(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocsr__SWIG_4(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocsr__SWIG_5(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocsr__SWIG_6(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'csctocsr'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocoo__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg8 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<float > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<float>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  csrtocoo<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(float)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocoo__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg8 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<double > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<double>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  csrtocoo<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(double)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocoo__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg8 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<long double > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<long double>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  csrtocoo<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(long double)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocoo__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg8 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_cfloat > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_cfloat>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  csrtocoo<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocoo__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg8 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_cdouble > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_cdouble>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  csrtocoo<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocoo__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg8 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_clongdouble > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_clongdouble>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  csrtocoo<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtocoo(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[6];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocoo__SWIG_1(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocoo__SWIG_2(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocoo__SWIG_3(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocoo__SWIG_4(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocoo__SWIG_5(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csrtocoo__SWIG_6(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'csrtocoo'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  float *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg9 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<float > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<float>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsr" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_FLOAT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (float*) array6->data;
+  }
+  cootocsr<float >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(float const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(float)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsr__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  double *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg9 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<double > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<double>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsr" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_DOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (double*) array6->data;
+  }
+  cootocsr<double >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(double const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(double)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsr__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  long double *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg9 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<long double > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<long double>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsr" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_LONGDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (long double*) array6->data;
+  }
+  cootocsr<long double >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long double const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(long double)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsr__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  npy_cfloat *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg9 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<npy_cfloat > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<npy_cfloat>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsr" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CFLOAT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_cfloat*) array6->data;
+  }
+  cootocsr<npy_cfloat >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsr__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  npy_cdouble *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg9 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<npy_cdouble > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<npy_cdouble>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsr" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_cdouble*) array6->data;
+  }
+  cootocsr<npy_cdouble >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsr__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  npy_clongdouble *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg9 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<npy_clongdouble > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<npy_clongdouble>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsr" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CLONGDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_clongdouble*) array6->data;
+  }
+  cootocsr<npy_clongdouble >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_clongdouble const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsr(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[7];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 6); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_FLOAT)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsr__SWIG_1(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_DOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsr__SWIG_2(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_LONGDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsr__SWIG_3(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CFLOAT)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsr__SWIG_4(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsr__SWIG_5(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsr__SWIG_6(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'cootocsr'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocoo__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg8 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<float > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<float>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  csctocoo<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(float)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocoo__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg8 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<double > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<double>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  csctocoo<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(double)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocoo__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg8 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<long double > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<long double>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  csctocoo<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(long double)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocoo__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg8 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_cfloat > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_cfloat>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  csctocoo<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocoo__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg8 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_cdouble > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_cdouble>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  csctocoo<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocoo__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg8 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_clongdouble > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_clongdouble>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csctocoo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csctocoo" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  csctocoo<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csctocoo(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[6];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocoo__SWIG_1(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocoo__SWIG_2(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocoo__SWIG_3(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocoo__SWIG_4(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocoo__SWIG_5(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_csctocoo__SWIG_6(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'csctocoo'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsc__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  float *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg9 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<float > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<float>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsc" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_FLOAT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (float*) array6->data;
+  }
+  cootocsc<float >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(float const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(float)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsc__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  double *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg9 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<double > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<double>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsc" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_DOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (double*) array6->data;
+  }
+  cootocsc<double >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(double const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(double)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsc__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  long double *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg9 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<long double > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<long double>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsc" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_LONGDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (long double*) array6->data;
+  }
+  cootocsc<long double >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long double const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(long double)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsc__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  npy_cfloat *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg9 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<npy_cfloat > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<npy_cfloat>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsc" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CFLOAT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_cfloat*) array6->data;
+  }
+  cootocsc<npy_cfloat >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsc__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  npy_cdouble *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg9 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<npy_cdouble > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<npy_cdouble>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsc" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_cdouble*) array6->data;
+  }
+  cootocsc<npy_cdouble >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsc__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  npy_clongdouble *arg6 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg8 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg9 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<int > *tmp8 ;
+  std::vector<npy_clongdouble > *tmp9 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<int>(); 
+    arg8 = tmp8; 
+  }
+  {
+    tmp9 = new std::vector<npy_clongdouble>(); 
+    arg9 = tmp9; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cootocsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cootocsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cootocsc" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (int*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CLONGDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_clongdouble*) array6->data;
+  }
+  cootocsc<npy_clongdouble >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_clongdouble const (*))arg6,arg7,arg8,arg9);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(int)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cootocsc(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[7];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 6); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_FLOAT)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsc__SWIG_1(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_DOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsc__SWIG_2(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_LONGDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsc__SWIG_3(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CFLOAT)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsc__SWIG_4(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsc__SWIG_5(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cootocsc__SWIG_6(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'cootocsc'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrplcsr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  float *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg11 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<float > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<float>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrplcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrplcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrplcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_FLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (float*) array8->data;
+  }
+  csrplcsr<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(float)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrplcsr__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg11 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrplcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrplcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrplcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_DOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (double*) array8->data;
+  }
+  csrplcsr<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrplcsr__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  long double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg11 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<long double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<long double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrplcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrplcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrplcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_LONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (long double*) array8->data;
+  }
+  csrplcsr<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(long double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrplcsr__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cfloat *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg11 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cfloat > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cfloat>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrplcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrplcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrplcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CFLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cfloat*) array8->data;
+  }
+  csrplcsr<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrplcsr__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg11 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrplcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrplcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrplcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cdouble*) array8->data;
+  }
+  csrplcsr<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrplcsr__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_clongdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg11 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_clongdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_clongdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrplcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrplcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrplcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CLONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_clongdouble*) array8->data;
+  }
+  csrplcsr<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrplcsr(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[9];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 8); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_FLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrplcsr__SWIG_1(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_DOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrplcsr__SWIG_2(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_LONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrplcsr__SWIG_3(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CFLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrplcsr__SWIG_4(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrplcsr__SWIG_5(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrplcsr__SWIG_6(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'csrplcsr'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscplcsc__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  float *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg11 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<float > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<float>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscplcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscplcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscplcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_FLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (float*) array8->data;
+  }
+  cscplcsc<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(float)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscplcsc__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg11 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscplcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscplcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscplcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_DOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (double*) array8->data;
+  }
+  cscplcsc<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscplcsc__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  long double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg11 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<long double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<long double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscplcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscplcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscplcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_LONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (long double*) array8->data;
+  }
+  cscplcsc<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(long double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscplcsc__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cfloat *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg11 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cfloat > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cfloat>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscplcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscplcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscplcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CFLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cfloat*) array8->data;
+  }
+  cscplcsc<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscplcsc__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg11 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscplcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscplcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscplcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cdouble*) array8->data;
+  }
+  cscplcsc<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscplcsc__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_clongdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg11 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_clongdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_clongdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscplcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscplcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscplcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CLONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_clongdouble*) array8->data;
+  }
+  cscplcsc<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscplcsc(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[9];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 8); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_FLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscplcsc__SWIG_1(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_DOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscplcsc__SWIG_2(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_LONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscplcsc__SWIG_3(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CFLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscplcsc__SWIG_4(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscplcsc__SWIG_5(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscplcsc__SWIG_6(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'cscplcsc'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmucsr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  float *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg11 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<float > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<float>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrmucsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmucsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmucsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_FLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (float*) array8->data;
+  }
+  csrmucsr<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(float)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmucsr__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg11 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrmucsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmucsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmucsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_DOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (double*) array8->data;
+  }
+  csrmucsr<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmucsr__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  long double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg11 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<long double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<long double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrmucsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmucsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmucsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_LONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (long double*) array8->data;
+  }
+  csrmucsr<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(long double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmucsr__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cfloat *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg11 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cfloat > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cfloat>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrmucsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmucsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmucsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CFLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cfloat*) array8->data;
+  }
+  csrmucsr<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmucsr__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg11 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrmucsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmucsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmucsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cdouble*) array8->data;
+  }
+  csrmucsr<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmucsr__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_clongdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg11 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_clongdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_clongdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrmucsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmucsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmucsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CLONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_clongdouble*) array8->data;
+  }
+  csrmucsr<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmucsr(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[9];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 8); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_FLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrmucsr__SWIG_1(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_DOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrmucsr__SWIG_2(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_LONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrmucsr__SWIG_3(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CFLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrmucsr__SWIG_4(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrmucsr__SWIG_5(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrmucsr__SWIG_6(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'csrmucsr'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmucsc__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  float *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg11 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<float > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<float>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscmucsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmucsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmucsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_FLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (float*) array8->data;
+  }
+  cscmucsc<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(float)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmucsc__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg11 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscmucsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmucsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmucsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_DOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (double*) array8->data;
+  }
+  cscmucsc<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmucsc__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  long double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg11 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<long double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<long double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscmucsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmucsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmucsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_LONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (long double*) array8->data;
+  }
+  cscmucsc<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(long double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmucsc__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cfloat *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg11 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cfloat > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cfloat>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscmucsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmucsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmucsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CFLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cfloat*) array8->data;
+  }
+  cscmucsc<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmucsc__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg11 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscmucsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmucsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmucsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cdouble*) array8->data;
+  }
+  cscmucsc<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmucsc__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_clongdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg11 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_clongdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_clongdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscmucsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmucsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmucsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CLONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_clongdouble*) array8->data;
+  }
+  cscmucsc<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmucsc(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[9];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 8); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_FLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscmucsc__SWIG_1(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_DOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscmucsc__SWIG_2(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_LONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscmucsc__SWIG_3(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CFLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscmucsc__SWIG_4(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscmucsc__SWIG_5(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscmucsc__SWIG_6(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'cscmucsc'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmux__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  float *arg6 ;
+  std::vector<float > *arg7 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<float > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<float>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_FLOAT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (float*) array6->data;
+  }
+  csrmux<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(float const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(float)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmux__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  double *arg6 ;
+  std::vector<double > *arg7 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<double > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<double>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_DOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (double*) array6->data;
+  }
+  csrmux<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(double const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(double)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmux__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  long double *arg6 ;
+  std::vector<long double > *arg7 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<long double > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<long double>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_LONGDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (long double*) array6->data;
+  }
+  csrmux<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(long double const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(long double)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmux__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  npy_cfloat *arg6 ;
+  std::vector<npy_cfloat > *arg7 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<npy_cfloat > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<npy_cfloat>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CFLOAT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_cfloat*) array6->data;
+  }
+  csrmux<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,(npy_cfloat const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmux__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  npy_cdouble *arg6 ;
+  std::vector<npy_cdouble > *arg7 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<npy_cdouble > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<npy_cdouble>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_cdouble*) array6->data;
+  }
+  csrmux<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,(npy_cdouble const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmux__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  npy_clongdouble *arg6 ;
+  std::vector<npy_clongdouble > *arg7 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<npy_clongdouble > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<npy_clongdouble>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CLONGDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_clongdouble*) array6->data;
+  }
+  csrmux<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,(npy_clongdouble const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrmux(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[7];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 6); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_FLOAT)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrmux__SWIG_1(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_DOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrmux__SWIG_2(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_LONGDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrmux__SWIG_3(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CFLOAT)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrmux__SWIG_4(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrmux__SWIG_5(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrmux__SWIG_6(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'csrmux'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmux__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  float *arg6 ;
+  std::vector<float > *arg7 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<float > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<float>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cscmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_FLOAT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (float*) array6->data;
+  }
+  cscmux<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(float const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(float)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmux__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  double *arg6 ;
+  std::vector<double > *arg7 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<double > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<double>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cscmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_DOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (double*) array6->data;
+  }
+  cscmux<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(double const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(double)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmux__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  long double *arg6 ;
+  std::vector<long double > *arg7 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<long double > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<long double>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cscmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_LONGDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (long double*) array6->data;
+  }
+  cscmux<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(long double const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(long double)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmux__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  npy_cfloat *arg6 ;
+  std::vector<npy_cfloat > *arg7 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<npy_cfloat > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<npy_cfloat>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cscmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CFLOAT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_cfloat*) array6->data;
+  }
+  cscmux<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,(npy_cfloat const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmux__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  npy_cdouble *arg6 ;
+  std::vector<npy_cdouble > *arg7 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<npy_cdouble > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<npy_cdouble>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cscmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_cdouble*) array6->data;
+  }
+  cscmux<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,(npy_cdouble const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmux__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  npy_clongdouble *arg6 ;
+  std::vector<npy_clongdouble > *arg7 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  std::vector<npy_clongdouble > *tmp7 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  {
+    tmp7 = new std::vector<npy_clongdouble>(); 
+    arg7 = tmp7; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cscmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscmux" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscmux" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CLONGDOUBLE, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (npy_clongdouble*) array6->data;
+  }
+  cscmux<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,(npy_clongdouble const (*))arg6,arg7);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscmux(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[7];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 6); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_FLOAT)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cscmux__SWIG_1(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_DOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cscmux__SWIG_2(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_LONGDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cscmux__SWIG_3(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CFLOAT)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cscmux__SWIG_4(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cscmux__SWIG_5(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_cscmux__SWIG_6(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'cscmux'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrelmulcsr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  float *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg11 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<float > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<float>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrelmulcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrelmulcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrelmulcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_FLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (float*) array8->data;
+  }
+  csrelmulcsr<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(float)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrelmulcsr__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg11 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrelmulcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrelmulcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrelmulcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_DOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (double*) array8->data;
+  }
+  csrelmulcsr<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrelmulcsr__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  long double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg11 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<long double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<long double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrelmulcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrelmulcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrelmulcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_LONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (long double*) array8->data;
+  }
+  csrelmulcsr<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(long double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrelmulcsr__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cfloat *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg11 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cfloat > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cfloat>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrelmulcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrelmulcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrelmulcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CFLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cfloat*) array8->data;
+  }
+  csrelmulcsr<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrelmulcsr__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg11 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrelmulcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrelmulcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrelmulcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cdouble*) array8->data;
+  }
+  csrelmulcsr<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrelmulcsr__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_clongdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg11 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_clongdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_clongdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrelmulcsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrelmulcsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrelmulcsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CLONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_clongdouble*) array8->data;
+  }
+  csrelmulcsr<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrelmulcsr(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[9];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 8); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_FLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrelmulcsr__SWIG_1(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_DOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrelmulcsr__SWIG_2(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_LONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrelmulcsr__SWIG_3(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CFLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrelmulcsr__SWIG_4(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrelmulcsr__SWIG_5(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_csrelmulcsr__SWIG_6(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'csrelmulcsr'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscelmulcsc__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  float *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg11 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<float > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<float>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscelmulcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscelmulcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscelmulcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_FLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (float*) array8->data;
+  }
+  cscelmulcsc<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(float)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscelmulcsc__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg11 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscelmulcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscelmulcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscelmulcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_DOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (double*) array8->data;
+  }
+  cscelmulcsc<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscelmulcsc__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  long double *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg11 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<long double > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<long double>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscelmulcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscelmulcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscelmulcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_LONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (long double*) array8->data;
+  }
+  cscelmulcsc<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(long double)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscelmulcsc__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cfloat *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg11 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cfloat > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cfloat>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscelmulcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscelmulcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscelmulcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CFLOAT, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cfloat*) array8->data;
+  }
+  cscelmulcsc<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscelmulcsc__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_cdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg11 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_cdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_cdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscelmulcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscelmulcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscelmulcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_cdouble*) array8->data;
+  }
+  cscelmulcsc<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscelmulcsc__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  int *arg6 ;
+  int *arg7 ;
+  npy_clongdouble *arg8 ;
+  std::vector<int > *arg9 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg11 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *array6 = NULL ;
+  int is_new_object6 ;
+  PyArrayObject *array7 = NULL ;
+  int is_new_object7 ;
+  PyArrayObject *array8 = NULL ;
+  int is_new_object8 ;
+  std::vector<int > *tmp9 ;
+  std::vector<int > *tmp10 ;
+  std::vector<npy_clongdouble > *tmp11 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  
+  {
+    tmp9 = new std::vector<int>(); 
+    arg9 = tmp9; 
+  }
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<npy_clongdouble>(); 
+    arg11 = tmp11; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscelmulcsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cscelmulcsc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cscelmulcsc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6);
+    if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1)) SWIG_fail;
+    arg6 = (int*) array6->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7);
+    if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1)) SWIG_fail;
+    arg7 = (int*) array7->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array8 = obj_to_array_contiguous_allow_conversion(obj7, PyArray_CLONGDOUBLE, &is_new_object8);
+    if (!array8 || !require_dimensions(array8,1) || !require_size(array8,size,1)) SWIG_fail;
+    arg8 = (npy_clongdouble*) array8->data;
+  }
+  cscelmulcsc<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble const (*))arg8,arg9,arg10,arg11);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg9)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(int)*length);	 
+    delete arg9; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg10)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg10))[0]),sizeof(int)*length);	 
+    delete arg10; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg11)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  {
+    if (is_new_object6 && array6) Py_DECREF(array6);
+  }
+  {
+    if (is_new_object7 && array7) Py_DECREF(array7);
+  }
+  {
+    if (is_new_object8 && array8) Py_DECREF(array8);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cscelmulcsc(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[9];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 8); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_FLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscelmulcsc__SWIG_1(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_DOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscelmulcsc__SWIG_2(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_LONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscelmulcsc__SWIG_3(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CFLOAT)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscelmulcsc__SWIG_4(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscelmulcsc__SWIG_5(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 8) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0;
+              }
+              if (_v) {
+                {
+                  _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0;
+                }
+                if (_v) {
+                  {
+                    _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+                  }
+                  if (_v) {
+                    return _wrap_cscelmulcsc__SWIG_6(self, args);
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'cscelmulcsc'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_spdiags__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg8 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<float > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<float>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:spdiags",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "spdiags" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "spdiags" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "spdiags" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[2] = {
+      -1,-1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,2) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  spdiags<float >(arg1,arg2,arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(float)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_spdiags__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg8 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<double > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<double>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:spdiags",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "spdiags" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "spdiags" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "spdiags" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[2] = {
+      -1,-1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,2) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  spdiags<double >(arg1,arg2,arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(double)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_spdiags__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg8 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<long double > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<long double>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:spdiags",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "spdiags" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "spdiags" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "spdiags" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[2] = {
+      -1,-1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,2) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  spdiags<long double >(arg1,arg2,arg3,(int const (*))arg4,(long double const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(long double)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_spdiags__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg8 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_cfloat > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_cfloat>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:spdiags",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "spdiags" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "spdiags" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "spdiags" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[2] = {
+      -1,-1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,2) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  spdiags<npy_cfloat >(arg1,arg2,arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_spdiags__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg8 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_cdouble > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_cdouble>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:spdiags",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "spdiags" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "spdiags" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "spdiags" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[2] = {
+      -1,-1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,2) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  spdiags<npy_cdouble >(arg1,arg2,arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_spdiags__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  std::vector<int > *arg6 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg7 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg8 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  std::vector<int > *tmp6 ;
+  std::vector<int > *tmp7 ;
+  std::vector<npy_clongdouble > *tmp8 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  {
+    tmp6 = new std::vector<int>(); 
+    arg6 = tmp6; 
+  }
+  {
+    tmp7 = new std::vector<int>(); 
+    arg7 = tmp7; 
+  }
+  {
+    tmp8 = new std::vector<npy_clongdouble>(); 
+    arg8 = tmp8; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:spdiags",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "spdiags" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "spdiags" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "spdiags" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast<int >(val3);
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_npy_clongdouble, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "spdiags" "', argument " "5"" of type '" "npy_clongdouble const []""'"); 
+  } 
+  arg5 = reinterpret_cast<npy_clongdouble * >(argp5);
+  spdiags<npy_clongdouble >(arg1,arg2,arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,arg6,arg7,arg8);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(int)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg7)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(int)*length);	 
+    delete arg7; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg8)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg8; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_spdiags(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[6];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_spdiags__SWIG_1(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_spdiags__SWIG_2(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_spdiags__SWIG_3(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_spdiags__SWIG_4(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_spdiags__SWIG_5(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 5) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              return _wrap_spdiags__SWIG_6(self, args);
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'spdiags'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtodense__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  float *arg6 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *temp6 = NULL ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrtodense",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtodense" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtodense" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_FLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (float*) array5->data;
+  }
+  {
+    temp6 = obj_to_array_no_conversion(obj5,PyArray_FLOAT);
+    if (!temp6 || !require_contiguous(temp6)) SWIG_fail;
+    arg6 = (float*) temp6->data;
+  }
+  csrtodense<float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtodense__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  double *arg6 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *temp6 = NULL ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrtodense",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtodense" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtodense" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_DOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (double*) array5->data;
+  }
+  {
+    temp6 = obj_to_array_no_conversion(obj5,PyArray_DOUBLE);
+    if (!temp6 || !require_contiguous(temp6)) SWIG_fail;
+    arg6 = (double*) temp6->data;
+  }
+  csrtodense<double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtodense__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long double *arg5 ;
+  long double *arg6 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *temp6 = NULL ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrtodense",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtodense" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtodense" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long double*) array5->data;
+  }
+  {
+    temp6 = obj_to_array_no_conversion(obj5,PyArray_LONGDOUBLE);
+    if (!temp6 || !require_contiguous(temp6)) SWIG_fail;
+    arg6 = (long double*) temp6->data;
+  }
+  csrtodense<long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtodense__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat *arg5 ;
+  npy_cfloat *arg6 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *temp6 = NULL ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrtodense",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtodense" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtodense" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CFLOAT, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cfloat*) array5->data;
+  }
+  {
+    temp6 = obj_to_array_no_conversion(obj5,PyArray_CFLOAT);
+    if (!temp6 || !require_contiguous(temp6)) SWIG_fail;
+    arg6 = (npy_cfloat*) temp6->data;
+  }
+  csrtodense<npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtodense__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble *arg5 ;
+  npy_cdouble *arg6 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  PyArrayObject *temp6 = NULL ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrtodense",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtodense" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtodense" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_cdouble*) array5->data;
+  }
+  {
+    temp6 = obj_to_array_no_conversion(obj5,PyArray_CDOUBLE);
+    if (!temp6 || !require_contiguous(temp6)) SWIG_fail;
+    arg6 = (npy_cdouble*) temp6->data;
+  }
+  csrtodense<npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtodense__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_clongdouble *arg5 ;
+  npy_clongdouble *arg6 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  PyArrayObject *array4 = NULL ;
+  int is_new_object4 ;
+  PyArrayObject *array5 = NULL ;
+  int is_new_object5 ;
+  void *argp6 = 0 ;
+  int res6 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrtodense",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "csrtodense" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "csrtodense" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[1] = {
+      -1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_INT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,1) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (int*) array3->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array4 = obj_to_array_contiguous_allow_conversion(obj3, PyArray_INT, &is_new_object4);
+    if (!array4 || !require_dimensions(array4,1) || !require_size(array4,size,1)) SWIG_fail;
+    arg4 = (int*) array4->data;
+  }
+  {
+    int size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_CLONGDOUBLE, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (npy_clongdouble*) array5->data;
+  }
+  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_npy_clongdouble, 0 |  0 );
+  if (!SWIG_IsOK(res6)) {
+    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "csrtodense" "', argument " "6"" of type '" "npy_clongdouble []""'"); 
+  } 
+  arg6 = reinterpret_cast<npy_clongdouble * >(argp6);
+  csrtodense<npy_clongdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble const (*))arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  {
+    if (is_new_object4 && array4) Py_DECREF(array4);
+  }
+  {
+    if (is_new_object5 && array5) Py_DECREF(array5);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_csrtodense(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[7];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 6); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_FLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_FLOAT)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrtodense__SWIG_1(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_DOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_DOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrtodense__SWIG_2(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_LONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_LONGDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrtodense__SWIG_3(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CFLOAT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CFLOAT)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrtodense__SWIG_4(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrtodense__SWIG_5(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 6) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_INT)) ? 1 : 0;
+        }
+        if (_v) {
+          {
+            _v = (is_array(argv[3]) && PyArray_CanCastSafely(PyArray_TYPE(argv[3]),PyArray_INT)) ? 1 : 0;
+          }
+          if (_v) {
+            {
+              _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+              }
+              if (_v) {
+                return _wrap_csrtodense__SWIG_6(self, args);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'csrtodense'");
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_densetocsr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  float *arg3 ;
+  std::vector<int > *arg4 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg5 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg6 = (std::vector<float > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  std::vector<int > *tmp4 ;
+  std::vector<int > *tmp5 ;
+  std::vector<float > *tmp6 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  {
+    tmp4 = new std::vector<int>(); 
+    arg4 = tmp4; 
+  }
+  {
+    tmp5 = new std::vector<int>(); 
+    arg5 = tmp5; 
+  }
+  {
+    tmp6 = new std::vector<float>(); 
+    arg6 = tmp6; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOO:densetocsr",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "densetocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "densetocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[2] = {
+      -1,-1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_FLOAT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,2) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (float*) array3->data;
+  }
+  densetocsr<float >(arg1,arg2,(float const (*))arg3,arg4,arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg4)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg4))[0]),sizeof(int)*length);	 
+    delete arg4; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg5)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg5))[0]),sizeof(int)*length);	 
+    delete arg5; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(float)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_densetocsr__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  double *arg3 ;
+  std::vector<int > *arg4 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg5 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg6 = (std::vector<double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  std::vector<int > *tmp4 ;
+  std::vector<int > *tmp5 ;
+  std::vector<double > *tmp6 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  {
+    tmp4 = new std::vector<int>(); 
+    arg4 = tmp4; 
+  }
+  {
+    tmp5 = new std::vector<int>(); 
+    arg5 = tmp5; 
+  }
+  {
+    tmp6 = new std::vector<double>(); 
+    arg6 = tmp6; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOO:densetocsr",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "densetocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "densetocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[2] = {
+      -1,-1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_DOUBLE, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,2) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (double*) array3->data;
+  }
+  densetocsr<double >(arg1,arg2,(double const (*))arg3,arg4,arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg4)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg4))[0]),sizeof(int)*length);	 
+    delete arg4; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg5)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg5))[0]),sizeof(int)*length);	 
+    delete arg5; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(double)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_densetocsr__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  long double *arg3 ;
+  std::vector<int > *arg4 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg5 = (std::vector<int > *) 0 ;
+  std::vector<long double > *arg6 = (std::vector<long double > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  std::vector<int > *tmp4 ;
+  std::vector<int > *tmp5 ;
+  std::vector<long double > *tmp6 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  {
+    tmp4 = new std::vector<int>(); 
+    arg4 = tmp4; 
+  }
+  {
+    tmp5 = new std::vector<int>(); 
+    arg5 = tmp5; 
+  }
+  {
+    tmp6 = new std::vector<long double>(); 
+    arg6 = tmp6; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOO:densetocsr",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "densetocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "densetocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[2] = {
+      -1,-1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_LONGDOUBLE, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,2) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (long double*) array3->data;
+  }
+  densetocsr<long double >(arg1,arg2,(long double const (*))arg3,arg4,arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg4)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg4))[0]),sizeof(int)*length);	 
+    delete arg4; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg5)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg5))[0]),sizeof(int)*length);	 
+    delete arg5; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_LONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(long double)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_densetocsr__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  npy_cfloat *arg3 ;
+  std::vector<int > *arg4 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg5 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat > *arg6 = (std::vector<npy_cfloat > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  std::vector<int > *tmp4 ;
+  std::vector<int > *tmp5 ;
+  std::vector<npy_cfloat > *tmp6 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  {
+    tmp4 = new std::vector<int>(); 
+    arg4 = tmp4; 
+  }
+  {
+    tmp5 = new std::vector<int>(); 
+    arg5 = tmp5; 
+  }
+  {
+    tmp6 = new std::vector<npy_cfloat>(); 
+    arg6 = tmp6; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOO:densetocsr",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "densetocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "densetocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[2] = {
+      -1,-1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_CFLOAT, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,2) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (npy_cfloat*) array3->data;
+  }
+  densetocsr<npy_cfloat >(arg1,arg2,(npy_cfloat const (*))arg3,arg4,arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg4)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg4))[0]),sizeof(int)*length);	 
+    delete arg4; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg5)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg5))[0]),sizeof(int)*length);	 
+    delete arg5; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(npy_cfloat)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_densetocsr__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  npy_cdouble *arg3 ;
+  std::vector<int > *arg4 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg5 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble > *arg6 = (std::vector<npy_cdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyArrayObject *array3 = NULL ;
+  int is_new_object3 ;
+  std::vector<int > *tmp4 ;
+  std::vector<int > *tmp5 ;
+  std::vector<npy_cdouble > *tmp6 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  {
+    tmp4 = new std::vector<int>(); 
+    arg4 = tmp4; 
+  }
+  {
+    tmp5 = new std::vector<int>(); 
+    arg5 = tmp5; 
+  }
+  {
+    tmp6 = new std::vector<npy_cdouble>(); 
+    arg6 = tmp6; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOO:densetocsr",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "densetocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "densetocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  {
+    int size[2] = {
+      -1,-1
+    };
+    array3 = obj_to_array_contiguous_allow_conversion(obj2, PyArray_CDOUBLE, &is_new_object3);
+    if (!array3 || !require_dimensions(array3,2) || !require_size(array3,size,1)) SWIG_fail;
+    arg3 = (npy_cdouble*) array3->data;
+  }
+  densetocsr<npy_cdouble >(arg1,arg2,(npy_cdouble const (*))arg3,arg4,arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg4)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg4))[0]),sizeof(int)*length);	 
+    delete arg4; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg5)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg5))[0]),sizeof(int)*length);	 
+    delete arg5; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(npy_cdouble)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  return resultobj;
+fail:
+  {
+    if (is_new_object3 && array3) Py_DECREF(array3);
+  }
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_densetocsr__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  npy_clongdouble *arg3 ;
+  std::vector<int > *arg4 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg5 = (std::vector<int > *) 0 ;
+  std::vector<npy_clongdouble > *arg6 = (std::vector<npy_clongdouble > *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  std::vector<int > *tmp4 ;
+  std::vector<int > *tmp5 ;
+  std::vector<npy_clongdouble > *tmp6 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  {
+    tmp4 = new std::vector<int>(); 
+    arg4 = tmp4; 
+  }
+  {
+    tmp5 = new std::vector<int>(); 
+    arg5 = tmp5; 
+  }
+  {
+    tmp6 = new std::vector<npy_clongdouble>(); 
+    arg6 = tmp6; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOO:densetocsr",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "densetocsr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast<int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "densetocsr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast<int >(val2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_npy_clongdouble, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "densetocsr" "', argument " "3"" of type '" "npy_clongdouble const []""'"); 
+  } 
+  arg3 = reinterpret_cast<npy_clongdouble * >(argp3);
+  densetocsr<npy_clongdouble >(arg1,arg2,(npy_clongdouble const (*))arg3,arg4,arg5,arg6);
+  
+  resultobj = SWIG_Py_Void();
+  {
+    int length = (arg4)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg4))[0]),sizeof(int)*length);	 
+    delete arg4; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg5)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg5))[0]),sizeof(int)*length);	 
+    delete arg5; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg6)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length, PyArray_CLONGDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg6))[0]),sizeof(npy_clongdouble)*length);	 
+    delete arg6; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_densetocsr(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_FLOAT)) ? 1 : 0;
+        }
+        if (_v) {
+          return _wrap_densetocsr__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_DOUBLE)) ? 1 : 0;
+        }
+        if (_v) {
+          return _wrap_densetocsr__SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_LONGDOUBLE)) ? 1 : 0;
+        }
+        if (_v) {
+          return _wrap_densetocsr__SWIG_3(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_CFLOAT)) ? 1 : 0;
+        }
+        if (_v) {
+          return _wrap_densetocsr__SWIG_4(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_CDOUBLE)) ? 1 : 0;
+        }
+        if (_v) {
+          return _wrap_densetocsr__SWIG_5(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          _v = (is_array(argv[2]) && PyArray_CanCastSafely(PyArray_TYPE(argv[2]),PyArray_CLONGDOUBLE)) ? 1 : 0;
+        }
+        if (_v) {
+          return _wrap_densetocsr__SWIG_6(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'densetocsr'");
+  return NULL;
+}
+
+
+static PyMethodDef SwigMethods[] = {
+	 { (char *)"csrtocsc", _wrap_csrtocsc, METH_VARARGS, NULL},
+	 { (char *)"csctocsr", _wrap_csctocsr, METH_VARARGS, NULL},
+	 { (char *)"csrtocoo", _wrap_csrtocoo, METH_VARARGS, NULL},
+	 { (char *)"cootocsr", _wrap_cootocsr, METH_VARARGS, NULL},
+	 { (char *)"csctocoo", _wrap_csctocoo, METH_VARARGS, NULL},
+	 { (char *)"cootocsc", _wrap_cootocsc, METH_VARARGS, NULL},
+	 { (char *)"csrplcsr", _wrap_csrplcsr, METH_VARARGS, NULL},
+	 { (char *)"cscplcsc", _wrap_cscplcsc, METH_VARARGS, NULL},
+	 { (char *)"csrmucsr", _wrap_csrmucsr, METH_VARARGS, NULL},
+	 { (char *)"cscmucsc", _wrap_cscmucsc, METH_VARARGS, NULL},
+	 { (char *)"csrmux", _wrap_csrmux, METH_VARARGS, NULL},
+	 { (char *)"cscmux", _wrap_cscmux, METH_VARARGS, NULL},
+	 { (char *)"csrelmulcsr", _wrap_csrelmulcsr, METH_VARARGS, NULL},
+	 { (char *)"cscelmulcsc", _wrap_cscelmulcsc, METH_VARARGS, NULL},
+	 { (char *)"spdiags", _wrap_spdiags, METH_VARARGS, NULL},
+	 { (char *)"csrtodense", _wrap_csrtodense, METH_VARARGS, NULL},
+	 { (char *)"densetocsr", _wrap_densetocsr, METH_VARARGS, NULL},
+	 { NULL, NULL, 0, NULL }
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_npy_clongdouble = {"_p_npy_clongdouble", "npy_clongdouble *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorTdouble_t = {"_p_std__vectorTdouble_t", "std::vector<double > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorTfloat_t = {"_p_std__vectorTfloat_t", "std::vector<float > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorTint_t = {"_p_std__vectorTint_t", "std::vector<int > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorTlong_double_t = {"_p_std__vectorTlong_double_t", "std::vector<long double > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorTnpy_cdouble_t = {"_p_std__vectorTnpy_cdouble_t", "std::vector<npy_cdouble > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorTnpy_cfloat_t = {"_p_std__vectorTnpy_cfloat_t", "std::vector<npy_cfloat > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorTnpy_clongdouble_t = {"_p_std__vectorTnpy_clongdouble_t", "std::vector<npy_clongdouble > *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_char,
+  &_swigt__p_npy_clongdouble,
+  &_swigt__p_std__vectorTdouble_t,
+  &_swigt__p_std__vectorTfloat_t,
+  &_swigt__p_std__vectorTint_t,
+  &_swigt__p_std__vectorTlong_double_t,
+  &_swigt__p_std__vectorTnpy_cdouble_t,
+  &_swigt__p_std__vectorTnpy_cfloat_t,
+  &_swigt__p_std__vectorTnpy_clongdouble_t,
+};
+
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_npy_clongdouble[] = {  {&_swigt__p_npy_clongdouble, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorTdouble_t[] = {  {&_swigt__p_std__vectorTdouble_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorTfloat_t[] = {  {&_swigt__p_std__vectorTfloat_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorTint_t[] = {  {&_swigt__p_std__vectorTint_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorTlong_double_t[] = {  {&_swigt__p_std__vectorTlong_double_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorTnpy_cdouble_t[] = {  {&_swigt__p_std__vectorTnpy_cdouble_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorTnpy_cfloat_t[] = {  {&_swigt__p_std__vectorTnpy_cfloat_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorTnpy_clongdouble_t[] = {  {&_swigt__p_std__vectorTnpy_clongdouble_t, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_char,
+  _swigc__p_npy_clongdouble,
+  _swigc__p_std__vectorTdouble_t,
+  _swigc__p_std__vectorTfloat_t,
+  _swigc__p_std__vectorTint_t,
+  _swigc__p_std__vectorTlong_double_t,
+  _swigc__p_std__vectorTnpy_cdouble_t,
+  _swigc__p_std__vectorTnpy_cfloat_t,
+  _swigc__p_std__vectorTnpy_clongdouble_t,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_const_info swig_const_table[] = {
+{0, 0, 0, 0.0, 0, 0}};
+
+#ifdef __cplusplus
+}
+#endif
+/*************************************************************************
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop though that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+**/
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head;
+  static int init_run = 0;
+  
+  clientdata = clientdata;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  /* Initialize the swig_module */
+  swig_module.type_initial = swig_type_initial;
+  swig_module.cast_initial = swig_cast_initial;
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (module_head) {
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  } else {
+    /* This is the first module loaded */
+    swig_module.next = &swig_module;
+    SWIG_SetModule(clientdata, &swig_module);
+  }
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+  
+  /* Python-specific SWIG API */
+#define SWIG_newvarlink()                             SWIG_Python_newvarlink()
+#define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
+#define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
+  
+  /* -----------------------------------------------------------------------------
+   * global variable support code.
+   * ----------------------------------------------------------------------------- */
+  
+  typedef struct swig_globalvar {
+    char       *name;                  /* Name of global variable */
+    PyObject *(*get_attr)(void);       /* Return the current value */
+    int       (*set_attr)(PyObject *); /* Set the value */
+    struct swig_globalvar *next;
+  } swig_globalvar;
+  
+  typedef struct swig_varlinkobject {
+    PyObject_HEAD
+    swig_globalvar *vars;
+  } swig_varlinkobject;
+  
+  SWIGINTERN PyObject *
+  swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
+    return PyString_FromString("<Swig global variables>");
+  }
+  
+  SWIGINTERN PyObject *
+  swig_varlink_str(swig_varlinkobject *v) {
+    PyObject *str = PyString_FromString("(");
+    swig_globalvar  *var;
+    for (var = v->vars; var; var=var->next) {
+      PyString_ConcatAndDel(&str,PyString_FromString(var->name));
+      if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
+    }
+    PyString_ConcatAndDel(&str,PyString_FromString(")"));
+    return str;
+  }
+  
+  SWIGINTERN int
+  swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
+    PyObject *str = swig_varlink_str(v);
+    fprintf(fp,"Swig global variables ");
+    fprintf(fp,"%s\n", PyString_AsString(str));
+    Py_DECREF(str);
+    return 0;
+  }
+  
+  SWIGINTERN void
+  swig_varlink_dealloc(swig_varlinkobject *v) {
+    swig_globalvar *var = v->vars;
+    while (var) {
+      swig_globalvar *n = var->next;
+      free(var->name);
+      free(var);
+      var = n;
+    }
+  }
+  
+  SWIGINTERN PyObject *
+  swig_varlink_getattr(swig_varlinkobject *v, char *n) {
+    PyObject *res = NULL;
+    swig_globalvar *var = v->vars;
+    while (var) {
+      if (strcmp(var->name,n) == 0) {
+        res = (*var->get_attr)();
+        break;
+      }
+      var = var->next;
+    }
+    if (res == NULL && !PyErr_Occurred()) {
+      PyErr_SetString(PyExc_NameError,"Unknown C global variable");
+    }
+    return res;
+  }
+  
+  SWIGINTERN int
+  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
+    int res = 1;
+    swig_globalvar *var = v->vars;
+    while (var) {
+      if (strcmp(var->name,n) == 0) {
+        res = (*var->set_attr)(p);
+        break;
+      }
+      var = var->next;
+    }
+    if (res == 1 && !PyErr_Occurred()) {
+      PyErr_SetString(PyExc_NameError,"Unknown C global variable");
+    }
+    return res;
+  }
+  
+  SWIGINTERN PyTypeObject*
+  swig_varlink_type(void) {
+    static char varlink__doc__[] = "Swig var link object";
+    static PyTypeObject varlink_type;
+    static int type_init = 0;  
+    if (!type_init) {
+      const PyTypeObject tmp
+      = {
+        PyObject_HEAD_INIT(NULL)
+        0,                                  /* Number of items in variable part (ob_size) */
+        (char *)"swigvarlink",              /* Type name (tp_name) */
+        sizeof(swig_varlinkobject),         /* Basic size (tp_basicsize) */
+        0,                                  /* Itemsize (tp_itemsize) */
+        (destructor) swig_varlink_dealloc,   /* Deallocator (tp_dealloc) */ 
+        (printfunc) swig_varlink_print,     /* Print (tp_print) */
+        (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
+        (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
+        0,                                  /* tp_compare */
+        (reprfunc) swig_varlink_repr,       /* tp_repr */
+        0,                                  /* tp_as_number */
+        0,                                  /* tp_as_sequence */
+        0,                                  /* tp_as_mapping */
+        0,                                  /* tp_hash */
+        0,                                  /* tp_call */
+        (reprfunc)swig_varlink_str,        /* tp_str */
+        0,                                  /* tp_getattro */
+        0,                                  /* tp_setattro */
+        0,                                  /* tp_as_buffer */
+        0,                                  /* tp_flags */
+        varlink__doc__,                     /* tp_doc */
+        0,                                  /* tp_traverse */
+        0,                                  /* tp_clear */
+        0,                                  /* tp_richcompare */
+        0,                                  /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+        0,                                  /* tp_del */
+#endif
+#ifdef COUNT_ALLOCS
+        0,0,0,0                             /* tp_alloc -> tp_next */
+#endif
+      };
+      varlink_type = tmp;
+      varlink_type.ob_type = &PyType_Type;
+      type_init = 1;
+    }
+    return &varlink_type;
+  }
+  
+  /* Create a variable linking object for use later */
+  SWIGINTERN PyObject *
+  SWIG_Python_newvarlink(void) {
+    swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
+    if (result) {
+      result->vars = 0;
+    }
+    return ((PyObject*) result);
+  }
+  
+  SWIGINTERN void 
+  SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
+    swig_varlinkobject *v = (swig_varlinkobject *) p;
+    swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
+    if (gv) {
+      size_t size = strlen(name)+1;
+      gv->name = (char *)malloc(size);
+      if (gv->name) {
+        strncpy(gv->name,name,size);
+        gv->get_attr = get_attr;
+        gv->set_attr = set_attr;
+        gv->next = v->vars;
+      }
+    }
+    v->vars = gv;
+  }
+  
+  SWIGINTERN PyObject *
+  SWIG_globals() {
+    static PyObject *_SWIG_globals = 0; 
+    if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();  
+    return _SWIG_globals;
+  }
+  
+  /* -----------------------------------------------------------------------------
+   * constants/methods manipulation
+   * ----------------------------------------------------------------------------- */
+  
+  /* Install Constants */
+  SWIGINTERN void
+  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
+    PyObject *obj = 0;
+    size_t i;
+    for (i = 0; constants[i].type; ++i) {
+      switch(constants[i].type) {
+      case SWIG_PY_POINTER:
+        obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
+        break;
+      case SWIG_PY_BINARY:
+        obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
+        break;
+      default:
+        obj = 0;
+        break;
+      }
+      if (obj) {
+        PyDict_SetItemString(d, constants[i].name, obj);
+        Py_DECREF(obj);
+      }
+    }
+  }
+  
+  /* -----------------------------------------------------------------------------*/
+  /* Fix SwigMethods to carry the callback ptrs when needed */
+  /* -----------------------------------------------------------------------------*/
+  
+  SWIGINTERN void
+  SWIG_Python_FixMethods(PyMethodDef *methods,
+    swig_const_info *const_table,
+    swig_type_info **types,
+    swig_type_info **types_initial) {
+    size_t i;
+    for (i = 0; methods[i].ml_name; ++i) {
+      char *c = methods[i].ml_doc;
+      if (c && (c = strstr(c, "swig_ptr: "))) {
+        int j;
+        swig_const_info *ci = 0;
+        char *name = c + 10;
+        for (j = 0; const_table[j].type; ++j) {
+          if (strncmp(const_table[j].name, name, 
+              strlen(const_table[j].name)) == 0) {
+            ci = &(const_table[j]);
+            break;
+          }
+        }
+        if (ci) {
+          size_t shift = (ci->ptype) - types;
+          swig_type_info *ty = types_initial[shift];
+          size_t ldoc = (c - methods[i].ml_doc);
+          size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
+          char *ndoc = (char*)malloc(ldoc + lptr + 10);
+          if (ndoc) {
+            char *buff = ndoc;
+            void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
+            if (ptr) {
+              strncpy(buff, methods[i].ml_doc, ldoc);
+              buff += ldoc;
+              strncpy(buff, "swig_ptr: ", 10);
+              buff += 10;
+              SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
+              methods[i].ml_doc = ndoc;
+            }
+          }
+        }
+      }
+    }
+  } 
+  
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------*
+ *  Partial Init method
+ * -----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+extern "C"
+#endif
+SWIGEXPORT void SWIG_init(void) {
+  PyObject *m, *d;
+  
+  /* Fix SwigMethods to carry the callback ptrs when needed */
+  SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
+  
+  m = Py_InitModule((char *) SWIG_name, SwigMethods);
+  d = PyModule_GetDict(m);
+  
+  SWIG_InitializeModule(0);
+  SWIG_InstallConstants(d,swig_const_table);
+  
+  
+  
+  import_array();
+  
+}
+

Deleted: trunk/Lib/sparse/sparsetools/spblas.f.src
===================================================================
--- trunk/Lib/sparse/sparsetools/spblas.f.src	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/sparsetools/spblas.f.src	2007-01-06 06:34:41 UTC (rev 2496)
@@ -1,432 +0,0 @@
-c    -*- fortran -*-
-c    author:  travis e. oliphant, 2004
-c
-c    computational tools for sparse matrices in <_t>
-c
-c    add two matrices in compressed sparse column format
-c        this assumes that the rowa indices are sorted for each column
-c        and indexes are 0-based
-
-      subroutine <_c>cscadd(n,a,rowa,ptra,nnzamax,b,rowb,ptrb,nnzbmax,
-     $     c,rowc,ptrc,nnzcmax,ierr)
-      <_t> a(0:nnzamax-1), b(0:nnzbmax-1)
-      <_t> c(0:nnzcmax-1), val
-      integer n, rowa(0:nnzamax-1), rowb(0:nnzbmax-1), rowc(0:nnzcmax-1)
-      integer ptra(0:n), ptrb(0:n), ptrc(0:n), nnzamax, nnzbmax
-      integer ia, ib, ra, rb, j, nnzcmax
-      integer ierr, nnzc
-      
-      ierr=0
-      nnzc=0
-      ia=ptra(0)
-      ib=ptrb(0)
-
-c  is there a need to initialize the output arrays?  assume no for now.
-c      do j = 0, n
-c         ptrc(j) = 0
-c      end do
-c      do j = 0, nnzcmax-1
-c         rowc(j) = 0
-c         c(j) = 0.0
-c      end do
-
-      do j = 0, n-1
-         iamax = ptra(j+1)
-         ibmax = ptrb(j+1)
-         do while ((ia.lt.iamax).and.(ib.lt.ibmax))
-            ra = rowa(ia)
-            rb = rowb(ib)
-            if (ra.eq.rb) then
-c     this is a common element
-               val = a(ia) + b(ib)
-               ia = ia + 1
-               ib = ib + 1
-               if (val.eq.0.0) goto 10
-               if (nnzc.ge.nnzcmax) goto 999
-               c(nnzc) = val
-               rowc(nnzc) = ra
-            else if (ra .lt. rb) then
-c     a has this but not b
-               val = a(ia)
-               ia = ia + 1 
-               if (val.eq.0.0) goto 10 
-               if (nnzc.ge.nnzcmax) goto 999
-               c(nnzc) = val
-               rowc(nnzc) = ra
-            else
-c     b has this but not a
-               val = b(ib)
-               ib = ib + 1
-               if (val.eq.0.0) goto 10
-               if (nnzc.ge.nnzcmax) goto 999
-               c(nnzc) = val
-               rowc(nnzc) = rb
-            end if
-            ptrc(j+1) = ptrc(j+1) + 1
-            nnzc = nnzc + 1
- 10         continue
-         end do
-         
-         if (ia .eq. iamax) then
-c     all finished with a for this column just copy the rest from b
-            do while (ib .lt. ibmax)
-               val = b(ib)
-               rb = rowb(ib)
-               ib = ib+1
-               if (val.ne.0.0) then
-                  if (nnzc.ge.nnzcmax) goto 999
-                  c(nnzc) = val
-                  rowc(nnzc) = rb
-                  ptrc(j+1) = ptrc(j+1) + 1
-                  nnzc = nnzc + 1
-               end if
-            end do
-         else if (ib .eq. ibmax) then
-c     all finished with b for this column just copy the rest from a
-            do while (ia .lt. iamax)
-               val = a(ia)
-               ra = rowa(ia)
-               ia = ia + 1
-               if (val.ne.0.0) then
-                  if (nnzc.ge.nnzcmax) goto 999
-                  c(nnzc) = val
-                  rowc(nnzc) = ra
-                  ptrc(j+1) = ptrc(j+1) + 1
-                  nnzc = nnzc + 1
-               end if
-            end do
-         end if 
-      end do
-
-c   successful completion (fix the ptr array)
-      cumsum = 0
-      do k = 1, n
-         cumsum = cumsum + ptrc(k)
-         ptrc(k) = cumsum         
-      end do
-      return
-      
-      
- 999  continue
-      ierr = 1
-      return
-      end subroutine <_c>cscadd
-
-c     element-by-element multiplication
-c     can have at most the minimum of nnzamax and nnzbmax
-
-      subroutine <_c>cscmul(n,a,rowa,ptra,nnzamax,b,rowb,ptrb,nnzbmax,
-     $     c,rowc,ptrc,nnzcmax,ierr)
-      <_t> a(0:nnzamax-1), b(0:nnzbmax-1)
-      <_t> c(0:nnzcmax-1), val
-      integer n, rowa(0:nnzamax-1), rowb(0:nnzbmax-1), rowc(0:nnzcmax-1)
-      integer ptra(0:n), ptrb(0:n), ptrc(0:n), nnzamax, nnzbmax
-      integer ia, ib, ra, rb, j, nnzcmax
-      integer ierr, k, cumsum
-      
-      ierr=0
-      nnzc=0
-      ia=ptra(0)
-      ib=ptrb(0)
-      do j = 0, n-1
-         iamax = ptra(j+1)
-         ibmax = ptrb(j+1)
-         do while ((ia.lt.iamax).and.(ib.lt.ibmax))
-            ra = rowa(ia)
-            rb = rowb(ib)
-            if (ra.eq.rb) then
-c     this is a common element
-               val = a(ia)*b(ib)
-               ia = ia + 1
-               ib = ib + 1
-               if (val.eq.0.0) goto 10
-               if (nnzc.ge.nnzcmax) goto 999
-               c(nnzc) = val
-               rowc(nnzc) = ra
-               ptrc(j+1) = ptrc(j+1) + 1
-               nnzc = nnzc + 1
-            else if (ra .lt. rb) then
-c     a has this but not b
-               ia = ia + 1
-            else
-c     b has this but not a
-               ib = ib + 1
-            end if
- 10         continue
-         end do
-      end do
-      
-c   successful completion (fix the ptr array)
-      cumsum = 0
-      do k = 1, n
-         cumsum = cumsum + ptrc(k)
-         ptrc(k) = cumsum         
-      end do
-
-      return
-      
- 999  continue
-      ierr = 1
-      return
-      end subroutine <_c>cscmul
-
-
-c  matrix-vector multiplication
-
-      subroutine <_c>cscmux(a,rowa,ptra,nnzamax,ncol,x,mrow,y)
-      <_t> a(0:nnzamax-1), x(0:ncol-1), y(0:mrow-1)
-      integer rowa(0:nnzamax-1), ptra(0:ncol)
-      integer nnzamax, mrow, ncol
-      integer i, j, ia, ra
-      
-      do i = 0, mrow-1
-         y(i) = 0.0
-      end do
-
-      do j = 0, ncol-1
-         do ia = ptra(j), ptra(j+1)-1
-            ra = rowa(ia)
-            y(ra) = y(ra) + a(ia)*x(j)
-         end do
-      end do
-
-      return
-      end subroutine <_c>cscmux
-
-
-      subroutine <_c>csrmux(a,cola,ptra,nnzamax,ncol,x,mrow,y)
-      <_t> a(0:nnzamax-1),x(0:ncol-1),y(0:mrow-1)
-      integer cola(0:nnzamax-1), ptra(0:mrow)
-      integer nnzamax, mrow, ncol
-      integer i, ja, ca
-      
-      do i = 0, mrow-1
-         y(i) = 0.0
-         do ja = ptra(i), ptra(i+1)-1
-            ca = cola(ja)
-            y(i) = y(i) + a(ja)*x(ca)           
-         end do
-      end do
-
-      return
-      end subroutine <_c>csrmux
-
-
-c     matrix multiplication
-c             c = a * b
-c
-c     where c is mxn csc matrix 
-c           a is mxk csc matrix
-c           b is kxn csr matrix
-c
-c     irow and kcol give position to start 
-c     nnzc gives current last element in output array (initialize to 0)
-c     intended to recall so that calculation can continue 
-c     if memory ran-out at last attempt
-
-
-
-      subroutine <_c>cscmucsr(m,k,n, a,rowa,ptra,nnzamax, b,colb,ptrb,
-     $     nnzbmax, c,rowc,ptrc,nnzcmax, irow,kcol,ierr)
-
-      <_t> a(0:nnzamax-1), b(0:nnzbmax-1), c(0:nnzcmax-1)
-      integer rowa(0:nnzamax-1), colb(0:nnzbmax-1), rowc(0:nnzcmax-1)
-      integer ptra(0:k), ptrb(0:k), ptrc(0:n)
-      integer nnzamax, nnzbmax, nnzcmax
-      integer m, k, n, irow, kcol, ierr, cumsum
-
-      integer kk, ii, jjb, jb, cb, ia, nnzc
-      <_t> val
-
-
-      nnzc = ierr
-      ierr = 0
-      do kk = kcol, n-1
-         do ii = irow, m-1
-            if (nnzc.ge.nnzcmax) goto 999
-            irow = 0
-            val = 0.0
-c   loop through the column array of b using the ptrb array
-c        so that we know which row we are on.
-            do jjb = 0, k-1
-               do jb = ptrb(jjb), ptrb(jjb+1)-1
-                  cb = colb(jb)
-                  if (cb.eq.kk) then
-c     see if aij is nonzero and if so add to val
-                     do ia = ptra(jjb), ptra(jjb+1)-1
-                        if (rowa(ia).eq.ii) then
-                           val = val + a(ia)*b(jb)
-                        end if
-                     end do
-                  end if
-               end do
-            end do
-            if (val.ne.0.0) then
-c     there is a non-zero value for this value of i and k
-               c(nnzc) = val
-               rowc(nnzc) = ii
-               ptrc(kk+1) = ptrc(kk+1) + 1
-               nnzc = nnzc+1               
-            end if
-         end do         
-      end do
-
-c   successful completion (fix the ptr array)
-      cumsum = 0
-      do kk = 1, n
-         cumsum = cumsum + ptrc(kk)
-         ptrc(kk) = cumsum         
-      end do
-      return
-
-      return
-
- 999  continue
-      kcol = kk
-      irow = ii
-      ierr = nnzc
-
-      return
-      end subroutine <_c>cscmucsr
-
-
-
-c     matrix multiplication
-c             c = a * b
-c
-c     where c is mxn csc matrix 
-c           a is mxk csr matrix
-c           b is kxn csc matrix
-c
-c     irow and jcol give position to start 
-c     bnum gives current size of output array
-c     intended to recall so that calculation can continue 
-c     where it left off if memory runs-out during calculation
-c
-      subroutine <_c>csrmucsc(m,n,a,cola,ptra,nnzamax,b,rowb,ptrb,
-     $     nnzbmax,c,rowc,ptrc,nnzcmax,irow,kcol,ierr)
-
-      <_t> a(0:nnzamax-1), b(0:nnzbmax-1), c(0:nnzcmax-1)
-      integer cola(0:nnzamax-1), rowb(0:nnzbmax-1), rowc(0:nnzcmax-1)
-      integer ptra(0:m), ptrb(0:n), ptrc(0:n)
-      integer nnzamax, nnzbmax, nnzcmax
-      integer m, n, irow, kcol, ierr, cumsum
-
-      integer kk, ii, nnzc
-      <_t> val
-
-      nnzc = ierr
-      ierr = 0
-      do kk = kcol, n-1
-         do ii = irow, m-1
-            if (nnzc.ge.nnzcmax) goto 999
-            irow = 0
-            val = 0.0
-c   loop through the non-zero rows of b
-            do ib = ptrb(kk), ptrb(kk+1)-1
-               rb = rowb(ib)
-               do ja = ptra(ii), ptra(ii+1)-1
-                  if (cola(ja).eq.rb) then
-                     val = val + a(ja)*b(ib)
-                  end if
-               end do
-            end do
-            if (val.ne.0.0) then
-c     there is a non-zero value for this value of i and k
-               c(nnzc) = val
-               rowc(nnzc) = ii
-               ptrc(kk+1) = ptrc(kk+1) + 1
-               nnzc = nnzc+1 
-            end if
-         end do
-      end do
-
-c   successful completion (fix the ptr array)
-      cumsum = 0
-      do kk = 1, n
-         cumsum = cumsum + ptrc(kk)
-         ptrc(kk) = cumsum         
-      end do
-      return
-
-
-      return
-
- 999  continue
-      kcol = kk
-      irow = ii
-      ierr = nnzc
-
-      return
-      end subroutine <_c>csrmucsc
-
-
-c     matrix-matrix multiplication
-c
-c          c = a * b    where  a, b, and c are 
-c                       compressed sparse column matrices
-c
-c     or it computes
-c
-c          c = b * a    where  b, a, and c are 
-c                       compressed sparse row matrices
-c   
-c     intentended for re-entry if nnzcmax is not big enough
-
-      subroutine <_c>cscmucsc(m,k,n,a,rowa,ptra,nnzamax,b,rowb,ptrb,
-     $     nnzbmax,c,rowc,ptrc,nnzcmax,irow,kcol,ierr)
-
-      <_t> a(0:nnzamax-1), b(0:nnzbmax-1), c(0:nnzcmax-1)
-      integer rowa(0:nnzamax-1), rowb(0:nnzbmax-1), rowc(0:nnzcmax-1)
-      integer ptra(0:k), ptrb(0:n), ptrc(0:n)
-      integer nnzamax, nnzbmax, nnzcmax
-      integer m, k, n, irow, kcol, ierr
-
-      integer kk, ii, jb, ia, ra, nnzc, cumsum
-      <_t> val
-      
-      nnzc = ierr
-      ierr = 0
-      do kk = kcol, n-1
-         do ii = irow, m-1
-            if (nnzc.ge.nnzcmax) goto 999
-c   reset the irow to 0
-            irow = 0
-            val = 0.0
-c   loop through the row array of b for this column
-            do jb = ptrb(kk), ptrb(kk+1)-1
-               ra = rowb(jb)
-               do ia = ptra(ra), ptra(ra+1)-1
-c     see if aij is nonzero and if so add to val
-                  if (rowa(ia).eq.ii) then
-                        val = val + a(ia)*b(jb)
-                  end if
-               end do
-            end do
-            if (val.ne.0.0) then
-c     there is a non-zero value for this value of i and k
-               c(nnzc) = val
-               rowc(nnzc) = ii
-               ptrc(kk+1) = ptrc(kk+1) + 1
-               nnzc = nnzc+1               
-            end if
-         end do         
-      end do
-
-c   successful completion (fix the ptr array)
-      cumsum = 0
-      do kk = 1, n
-         cumsum = cumsum + ptrc(kk)
-         ptrc(kk) = cumsum         
-      end do
-      return
-      
- 999  continue
-      kcol = kk
-      irow = ii
-      ierr = nnzc
-      
-      return
-      end subroutine <_c>cscmucsc
-     
-

Deleted: trunk/Lib/sparse/sparsetools/spconv.f.src
===================================================================
--- trunk/Lib/sparse/sparsetools/spconv.f.src	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/sparsetools/spconv.f.src	2007-01-06 06:34:41 UTC (rev 2496)
@@ -1,354 +0,0 @@
-c    -*- fortran -*-
-c    convert csc matrix a to csr matrix b
-c    convert csr matrix a to csc matrix b
-c    transpose csc matrix
-c    transpose csr matrix
-c    all depends on how you interpret the results
-         
-      subroutine <_c>transp(m,n,a,rowa,ptra,nnzamax,b,colb,ptrb)
-      <_t> a(0:nnzamax-1), b(0:nnzamax-1)
-      integer rowa(0:nnzamax-1), colb(0:nnzamax-1)
-      integer ptra(0:n), ptrb(0:m)
-      integer j, bnum, cola, ia, ra
-
-      ptrb(0) = 0
-      bnum = 0
-      do j = 0, m-1
-         do cola = 0, n-1
-            do ia = ptra(cola), ptra(cola+1)-1
-               ra = rowa(ia)
-               if (ra.eq.j) then
-                  b(bnum) = a(ia)
-                  colb(bnum) = cola
-                  bnum = bnum+1
-               end if
-            end do
-         end do
-         ptrb(j+1) = bnum
-      end do
-
-      return
-      end subroutine <_c>transp
-
-c      returns the index into the data array
-c      and the value
-      subroutine <_c>cscgetel(a,rowa,ptra,nnzamax,n,row,col,ind,val)
-      
-      <_t> a(0:nnzamax-1), val
-      integer rowa(0:nnzamax-1), ptra(0:n)
-      integer nnzamax, row, col, ind
-
-      integer ia
-
-      ind = -1
-      val = 0.0
-      do ia = ptra(col), ptra(col+1)-1
-         if (rowa(ia).eq.row) then
-            ind = ia
-            val = a(ia)
-            goto 10
-         end if
-      end do
-
- 10   continue
-      return 
-
-      end subroutine <_c>cscgetel
-
-      
-c      set an element into the data array (assumes there is room)
-c
-      subroutine <_c>cscsetel(a,rowa,ptra,nnzamax,n,row,col,val)
-
-      <_t> a(0:nnzamax-1), val
-      integer rowa(0:nnzamax-1), ptra(0:n)
-      integer nnza, n, row, col, nnzamax
-
-      integer ra, newia
-
-      nnza = ptra(n)
-      newia = ptra(col)
-      do ia = newia, ptra(col+1)-1
-         ra = rowa(ia)
-         if (ra.eq.row) then
-c     just replace and be done
-            a(ia) = val
-            goto 10
-         else if (ra.gt.row) then 
-            newia = ia
-            goto 5
-         end if
-      end do
-
-c     we are past where it should be stored
-c         (assumes sorted) so make room for this new element
-c     here so that it will run if this is the first entry in the
-c         column
- 5    continue
-      ia = newia
-      do iia = nnza, ia+1, -1
-         a(iia) = a(iia-1)
-         rowa(iia) = rowa(iia-1)
-      end do
-      a(ia) = val
-      rowa(ia) = row
-      do iia = col+1, n
-         ptra(iia) = ptra(iia)+1
-      end do
-
-      return
-
- 10   continue
-      
-      return
-      end subroutine <_c>cscsetel
-
-c     assumes sorted by column and then row 
-
-      subroutine <_c>cootocsc(n,vals,row,col,nnz,a,rowa,ptra,nnzamax,
-     $     ierr)
-      
-      <_t> vals(0:nnz-1), a(0:nnzamax-1)
-      integer rowa(0:nnzamax-1), ptra(0:n)
-      integer row(0:nnz-1), col(0:nnz-1)
-      integer n, nnzamax, nnz, ierr
-
-      <_t> val
-      integer j, k, cumsum
-
-      if (nnz.gt.nnzamax) goto 999
-      ierr=0
-      nnza=0
-      do k = 0, n-1
-         ptra(k) = 0
-      end do
-      do ia = 0, nnzamax-1
-         a(ia) = 0.0
-         rowa(ia) = 0
-      end do      
-      do k = 0, nnz-1
-         j = col(k)
-         val = vals(k)
-         if (val.ne.0.0) then
-            a(nnza) = val
-            rowa(nnza) = row(k)
-            ptra(j+1) = ptra(j+1) + 1
-            nnza = nnza + 1
-         end if
-      end do
-
-c   successful completion (fix the ptr array)
-      cumsum = 0
-      do k = 1, n
-         cumsum = cumsum + ptra(k)
-         ptra(k) = cumsum         
-      end do
-      return      
-
-      return
-
- 999  continue
-      ierr=1
-      return
-      end subroutine <_c>cootocsc
-
-      subroutine <_c>csctocoo(n, vals, row, col, a, rowa, ptra, nnzamax)
-      <_t> vals(0:nnzamax-1), a(0:nnzamax-1)
-      integer rowa(0:nnzamax-1), ptra(0:n)
-      integer row(0:nnzamax-1), col(0:nnzamax-1)
-      integer n, nnzamax
-
-      integer i, j, k
-
-      j = 0
-      do k = 0, n-1
-         do i = ptra(k), ptra(k+1)-1
-            row(j) = rowa(i)
-            col(j) = k
-            vals(j) = a(i)
-            j = j + 1
-         end do
-      end do
-
-      return
-      end subroutine <_c>csctocoo
-
-c     intended for re-entry in case a is too small
-
-      subroutine <_c>fulltocsc(m,n,fulla,a,rowa,ptra,nnzamax,
-     $     irow,jcol,ierr)
-      
-      <_t> fulla(0:m-1,0:n-1), a(0:nnzamax-1)
-      integer rowa(0:nnzamax-1), ptra(0:n)
-      integer m, n, nnzamax, irow, jcol, ierr
-
-      <_t> val
-      integer nnza, i, j, k, cumsum
-
-      ierr=0
-      nnza = ierr
-      do j = jcol, n-1
-         do i = irow, m-1
-            val = fulla(i,j)
-            if (val.ne.0.0) then
-               if (nnza.ge.nnzamax) goto 999
-               a(nnza) = val
-               rowa(nnza) = i
-               ptra(j+1) = ptra(j+1) + 1
-               nnza = nnza + 1
-            end if
-         end do
-      end do      
-
-c   successful completion (fix the ptr array)
-      cumsum = 0
-      do k = 1, n
-         cumsum = cumsum + ptra(k)
-         ptra(k) = cumsum         
-      end do
-      return
-
- 999  continue
-      ierr=nnza
-      irow = i
-      jcol = j
-      return
-      end subroutine <_c>fulltocsc
-
-
-      subroutine <_c>csctofull(m, n, fulla, a, rowa, ptra, nnzamax)
-
-      <_t> fulla(0:m-1, 0:n-1), a(0:nnzamax-1)
-      integer rowa(0:nnzamax-1), ptra(0:n)
-      integer m, n, nnzamax
-
-      integer ia, k
-c      integer i, j
-
-c      do j = 0, n-1
-c         do i = 0, m-1
-c            fulla(i,j) = 0.0
-c         end do
-c      end do
-
-      do k = 0, n-1
-         do ia = ptra(k), ptra(k+1)-1
-            fulla(rowa(ia),k) = a(ia)
-         end do
-      end do
-      
-      return
-      end subroutine <_c>csctofull
-
-
-c  extract a sub-matrix from a sparse matrix
-c     c = a(ibeg:iend, jbeg:jend)  (inclusive of end-points)
-c
-c     intended for re-entry if nnzcmax is not big enough 
-c      irow and jcol should initially be 0 and 0
-
-      subroutine <_c>cscextract(n,a,rowa,ptra,nnzamax,ibeg,iend,jbeg,
-     $     jend, c, rowc, ptrc, nnzcmax, irow, jcol, ierr)
-
-      <_t> a(0:nnzamax-1), c(0:nnzcmax-1)
-      integer rowa(0:nnzamax-1), rowc(0:nnzamax-1)
-      integer ptra(0:n), ptrc(0:jend-jbeg+1)
-      integer ibeg, iend, jbeg, jend
-      integer nnzamax, nnzcmax, irow, jcol, ierr
-
-      integer nnza, nc, j, iabeg, ia, k, cumsum
-
-      nc = jend-jbeg+1
-
-      nnza = ptra(n)
-      nnzc = ierr
-
-      if (jcol .lt. jbeg) jcol = jbeg
-
-      do j = jcol, jend
-         jc = j - jbeg
-c   look through row indices in this column, copy all those that are
-c      in required range.
-         iabeg = max(irow,ptra(j))
-         do ia = iabeg, ptra(j+1)-1
-            ra = rowa(ia)
-            if ((ra.le.iend).and.(ra.ge.ibeg)) then
-               if (nnzc.ge.nnzcmax) goto 999
-               c(nnzc) = a(ia)
-               rowc(nnzc) = ra-ibeg
-               ptrc(jc+1) = ptrc(jc+1) + 1
-               nnzc = nnzc + 1
-            end if
-         end do
-      end do
-
-c   successful completion (fix the ptr array)
-      cumsum = 0
-      do k = 1, n
-         cumsum = cumsum + ptrc(k)
-         ptrc(k) = cumsum         
-      end do
-      return
-
-
-      return
-
- 999  continue
-      ierr = nnzc
-      irow = ia
-      jcol = j
-      return
-      end subroutine <_c>cscextract
-
-
-      
-      subroutine <_c>diatocsc(m,n,diags,numdia,diasize,offsets,
-     $     a,rowa,ptra,nzmax, ierr)
-      
-      integer n, numdia, diasize, nzmax, ierr
-      <_t> diags(0:numdia-1, 0:diasize-1), a(0:nzmax-1)
-      <_t> val
-      integer offsets(0:numdia-1), rowa(0:nzmax-1)
-      integer ptra(0:n)
-
-      integer col, nnza, jj, row, idiag, ia
-
-      nnza = 0
-      ierr = 0
-c      write (*,*) "SDSD", m, n, numdia, diasize, nzmax
-      do col = 0, n-1
-c   Loop through the offsets 
-         do jj = 0, numdia-1
-            row = col - offsets(jj)
-            if ((row.ge.0).and.(row.lt.m)) then
-               idiag = min(row, col)
-               val = diags(jj, idiag)
-               if (val.ne.0.0) then
-                  if (nnza.ge.nzmax) goto 999
-c   find place to insert this row (inserted in sorted order)
-                  ia = ptra(col)
- 10               if ((ia.lt.ptra(col+1)).and.(rowa(ia).lt.row)) then
-                     ia = ia + 1
-                     goto 10
-                  end if
-                  do iia = nnza, ia+1, -1
-                     a(iia) = a(iia-1)
-                     rowa(iia) = rowa(iia-1)
-                  end do
-                  a(ia) = val
-                  rowa(ia) = row
-                  nnza = nnza + 1
-               end if
-            end if
-         end do
-         ptra(col+1) = nnza
-      end do
-
-      return 
-
- 999  continue
-      ierr = 1
-      return
-      
-
-      end subroutine <_c>diatocsc

Deleted: trunk/Lib/sparse/sparsetools.txt
===================================================================
--- trunk/Lib/sparse/sparsetools.txt	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/sparsetools.txt	2007-01-06 06:34:41 UTC (rev 2496)
@@ -1,129 +0,0 @@
-This is a list of the functions we need to replace sparsekit --- needed in all 4 precision formats (c, z, s, d)
-
-coocsr  --  converts coordinate to csr format 
-              (nrow, nnz, a, ir, jc, ao, jao, iao)
-              nrow -- dimension of the matrix
-              nnz  -- number of nonzero elements in matrix
-              a,ir,jc -- matrix in coordinate format a(k), ir(k), jc(k) 
-                        store then nnz nonzero elements of the matrix
-      
-              ao, jao, iao --- matrix in general sparse matrix format (CSR)
-                               ao containing values, jao containing column indices
-                               and iao being the pointer to the beginning of the row 
-                               in arrays a0 and jao
-
-getelm --  return a(i,j) for any (i,j) from a CSR-stored matrix
-              (i,j, a,ja,ia, iadd, sorted)
-              
-              i,j  --   row and column of element sought
-              a,ja,ia --- matrix in CSR format
-              sorted --- logical indicating whether the matrix is known to 
-                           have its column indices sorted in increasing order
-              getelm -- value of a(i,j)
-              iadd -- address of element a(i,j) in arrays (a,ja) if found
-                      zero otherwise
-
-submat --  extracts the submatrix A(i1:i2,j1:j2) and puts the result in matrix 
-            ao, iao, jao
-               (n, job, i1, i2, j1, j2, a, ja, ia, nr, nr, nc, ao, jao, iao)
-               n -- row dimension of matrix
-               i1,i2, j1, j2  --- slice select (i1 <= i2 and j1 <= j2)
-               a,ja,ia -- matrix in CSR format
-               job -- job indicator:  if job != 1 then the real values in a are 
-                                      NOT extracted, only the column indices are.
-                                      otherwise values as well as column indices are 
-                                      extracted.
-           
-                nr - number of rows of submatrix
-                nc - number of columns of submatrix
-                ao, jao, iao -- extracted matrix in general sparse format with 
-                                jao containing the column indices and iao being the
-                                pointer to the beginning of the row in arrays a, ja.
-
-aplb  --   computes C = A + B
-            (nrow, ncol, job, a, ja, ia, b, jb, ib, c, jc, ic, nzmax, iw, ierr)
-               nrow x ncol --- row dimension of A and B
-               job         --- integer job indicator (when job =0 only the 
-                                  structure (ie jc, ic) is computed and the
-                                  values are ignored.
-
-               a,ja,ia -- matrix A in CSR format
-               b,jb,ib -- matrix B in CSR format
-               nzmax -- the length of arrays c and jc.  amub will stop if result
-                          matrix has more elements than nzmax.
-
-              Return:
-                
-               c,jc,ic -- resulting matrix C = A + B
-               ierr    -- integer serving as error message
-                          0 -- normal return
-                         >0  means aplb stopped while computing the ith 
-                             row with i=ierr because number of elements in C > nzmax
-
-amub  --  computes C = A * B
-            (nrow, ncol, job, a, ja, ia, b, jb, ib, c, jc, ic, nzmax, iw, ierr)
-               nrow x ncol --- row dimension of A and B
-               job         --- integer job indicator (when job =0 only the 
-                                  structure (ie jc, ic) is computed and the
-                                  values are ignored.
-
-               a,ja,ia -- matrix A in CSR format
-               b,jb,ib -- matrix B in CSR format
-               nzmax -- the length of arrays c and jc.  amub will stop if result
-                          matrix has more elements than nzmax.
-
-              Return:
-                
-               c,jc,ic -- resulting matrix C = A * B
-               ierr    -- integer serving as error message
-                          0 -- normal return
-                         >0  means amub stopped while computing the ith 
-                             row with i=ierr because number of elements in C > nzmax
-
-
-
-amux  --   matrix by vector using the dot product form
-              (n, x, y, a, ja, ia)
-              n -- row dimension of A
-              x -- array of length equal to the column dimension of A
-              a, ja, ia -- input matrix in CSR format
-         
-              y -- array of length n,  containing the product y = Ax
-
-transp --  in place transposition routine.  (could use csrcsc instead for not inplace)
-              (nrow, ncol, a, ja, ia, iwk, ierr)
- 
-               nrow x ncol --- the row x column dimension of A
-               a, ja, ia  --  CSR format matrix  (ia is nrow+1 elements)
-               iwk  -- integer work array of same length as ja
-               
-               On return: 
-               ncol -- actual row dimension of transpose of input matrix
-               a,ja, ia --- transposed matrix in CSR format
-
-               ierr -- integer error message.  If the number of rows for the
-                       transposed matrix exceeds the input value of ncol
-                       then ierr is set to that number and transp quits 
-                       Otherwise ierr is set to 0.
-
-
-
-diacsr --- construct CSR matrix from diagonals 
-           (m,n,job, idiag, diag, ndiag, ioff, a, ja, ia)
-             
-              m,n -- sparse array will be mxn
-              job -- if job==0 then check for each entry in diag 
-                       whether this entry is zero.  If it is then do not
-                       include it in the output matrix.  
- 
-              idiag -- integer equal to the number of diagonals
-              diag  -- array of size (ndiag x idiag) containing the diagonals to
-                         be placed in A
-              ndiag -- integer equal to the first dimension of array diag
-              ioff  -- integer array of length idiag containing the offsets of
-                       the diagonals to be extracted.
-
-           on return:
- 
-              a, ja, ia --- matrix stored in CSR format
-

Modified: trunk/Lib/sparse/tests/test_sparse.py
===================================================================
--- trunk/Lib/sparse/tests/test_sparse.py	2007-01-06 06:01:15 UTC (rev 2495)
+++ trunk/Lib/sparse/tests/test_sparse.py	2007-01-06 06:34:41 UTC (rev 2496)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Authors: Travis Oliphant, Ed Schofield, Robert Cimrman, and others
+# Authors: Travis Oliphant, Ed Schofield, Robert Cimrman, Nathan Bell, and others
 
 """ Test functions for sparse matrices
 
@@ -363,8 +363,105 @@
         # assert_array_equal(B[(1,2,3),:], A[(1,2,3),:].todense())
 
 
+class _test_arith:
+    """
+    Test real/complex arithmetic
+    """
+    def arith_init(self):
+        #these can be represented exactly in FP (so arithmetic should be exact)
+        self.A = matrix([[-1.5,0,0,2.25],[3.125,0,-0.125,0],[0,-5.375,0,0]],float64)
+        self.B = matrix([[0,3.375,0,-7.875],[6.625,4.75,0,0],[3.5,6.0625,0,1]],float64)
+        
+        self.C = matrix([[0.375,0,-5,2.5],[0,7.25,0,-4.875],[0,-0.0625,0,0]],complex128)
+        self.C.imag = matrix([[1.25,0,0,-3.875],[0,4.125,0,2.75],[-0.0625,0,0,1]],float64)
 
-class test_csr(_test_cs, _test_horiz_slicing, ScipyTestCase):
+        #fractions are all x/16ths
+        assert_array_equal((self.A*16).astype(numpy.int32),16*self.A)
+        assert_array_equal((self.B*16).astype(numpy.int32),16*self.B)
+        assert_array_equal((self.C.real*16).astype(numpy.int32),16*self.C.real)
+        assert_array_equal((self.C.imag*16).astype(numpy.int32),16*self.C.imag)
+
+        self.Asp = self.spmatrix(self.A)
+        self.Bsp = self.spmatrix(self.B)
+        self.Csp = self.spmatrix(self.C)
+        
+        self.dtypes =  [float32,float64,complex64,complex128]
+
+    def check_pl(self):
+        self.arith_init()
+        
+        #basic tests
+        assert_array_equal(self.A+self.B,(self.Asp+self.Bsp).todense())
+        assert_array_equal(self.A+self.C,(self.Asp+self.Csp).todense())
+
+        #check conversions
+        for x in self.dtypes:
+            for y in self.dtypes:
+                for z in self.dtypes:
+                    A = self.A.astype(x)
+                    B = self.B.astype(y)
+                    C = self.C.astype(z)
+                    
+                    Asp = self.spmatrix(A)
+                    Bsp = self.spmatrix(B)
+                    Csp = self.spmatrix(C)
+
+                    D1 = A + B
+                    D2 = A + C
+                    D3 = B + C
+
+                    S1 = Asp + Bsp
+                    S2 = Asp + Csp
+                    S3 = Bsp + Csp
+                    
+                    assert_array_equal(D1,S1.todense())
+                    assert_array_equal(D2,S2.todense())
+                    assert_array_equal(D3,S3.todense())
+
+                    assert_array_equal(D1.dtype,S1.dtype)
+                    assert_array_equal(D2.dtype,S2.dtype)
+                    assert_array_equal(D3.dtype,S3.dtype)
+                    
+
+    def check_mu(self):
+        self.arith_init()
+        
+        #basic tests
+        assert_array_equal(self.A*self.B.T,(self.Asp*self.Bsp.T).todense())
+        assert_array_equal(self.A*self.C.T,(self.Asp*self.Csp.T).todense())
+
+        #check conversions
+        for x in self.dtypes:
+            for y in self.dtypes:
+                for z in self.dtypes:
+                    A = self.A.astype(x)
+                    B = self.B.astype(y)
+                    C = self.C.astype(z)
+                    
+                    Asp = self.spmatrix(A)
+                    Bsp = self.spmatrix(B)
+                    Csp = self.spmatrix(C)
+
+                    D1 = A * B.T
+                    D2 = A * C.T
+                    D3 = B * C.T
+
+                    S1 = Asp * Bsp.T
+                    S2 = Asp * Csp.T
+                    S3 = Bsp * Csp.T
+
+                    assert_array_equal(D1,S1.todense())
+                    assert_array_equal(D2,S2.todense())
+                    assert_array_equal(D3,S3.todense())
+
+                    assert_array_equal(D1.dtype,S1.dtype)
+                    assert_array_equal(D2.dtype,S2.dtype)
+                    assert_array_equal(D3.dtype,S3.dtype)
+
+
+
+
+class test_csr(_test_cs, _test_horiz_slicing, _test_arith, ScipyTestCase):
     spmatrix = csr_matrix
 
     def check_constructor1(self):
@@ -417,7 +514,7 @@
             assert(e.A.dtype.type == mytype)
 
 
-class test_csc(_test_cs, _test_vert_slicing, ScipyTestCase):
+class test_csc(_test_cs, _test_vert_slicing, _test_arith, ScipyTestCase):
     spmatrix = csc_matrix
 
     def check_constructor1(self):
@@ -639,7 +736,27 @@
         assert_array_equal(a.toarray(), b)
 
 class test_coo(ScipyTestCase):
+    def check_constructor1(self):
+        row  = numpy.array([2, 3, 1, 3, 0, 1, 3, 0, 2, 1, 2])
+        col  = numpy.array([0, 1, 0, 0, 1, 1, 2, 2, 2, 2, 1])
+        data = numpy.array([  6.,  10.,   3.,   9.,   1.,   4.,
+                              11.,   2.,   8.,   5.,   7.])
+        
+        coo = coo_matrix((data,(row,col)),(4,3))
+        
+        assert_array_equal(arange(12).reshape(4,3),coo.todense())
 
+    def check_constructor2(self):
+        #duplicate entries should be summed        
+        row  = numpy.array([0,1,2,2,2,2,0,0,2,2])
+        col  = numpy.array([0,2,0,2,1,1,1,0,0,2])
+        data = numpy.array([2,9,-4,5,7,0,-1,2,1,-5])
+        coo = coo_matrix((data,(row,col)),(3,3))
+
+        mat = matrix([[4,-1,0],[0,0,9],[-3,7,0]])
+        
+        assert_array_equal(mat,coo.todense())
+
     def check_normalize( self ):
         
         row  = numpy.array([2, 3, 1, 3, 0, 1, 3, 0, 2, 1, 2])




More information about the Scipy-svn mailing list