[Scipy-svn] r3302 - in trunk/scipy/sparse: . sparsetools tests

scipy-svn@scip... scipy-svn@scip...
Wed Sep 5 10:59:39 CDT 2007


Author: rc
Date: 2007-09-05 10:59:21 -0500 (Wed, 05 Sep 2007)
New Revision: 3302

Modified:
   trunk/scipy/sparse/sparse.py
   trunk/scipy/sparse/sparsetools/sparsetools.h
   trunk/scipy/sparse/sparsetools/sparsetools.i
   trunk/scipy/sparse/sparsetools/sparsetools.py
   trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx
   trunk/scipy/sparse/tests/test_sparse.py
Log:
added csr_matrix.get_submatrix()



Modified: trunk/scipy/sparse/sparse.py
===================================================================
--- trunk/scipy/sparse/sparse.py	2007-09-04 22:08:22 UTC (rev 3301)
+++ trunk/scipy/sparse/sparse.py	2007-09-05 15:59:21 UTC (rev 3302)
@@ -1462,6 +1462,17 @@
         """
         return _cs_matrix._ensure_sorted_indices(self, self.shape[0], self.shape[1], inplace)
 
+    def get_submatrix( self, slice0, slice1 ):
+        """Return a submatrix of this matrix (new matrix is created)."""
+        aux = sparsetools.get_csr_submatrix( self.shape[0], self.shape[1],
+                                             self.indptr, self.indices,
+                                             self.data,
+                                             slice0.start, slice0.stop,
+                                             slice1.start, slice1.stop )
+        data, indices, indptr = aux[2], aux[1], aux[0]
+        return self.__class__( (data, indices, indptr),
+                               dims = (slice0.stop - slice0.start,
+                                       slice1.stop - slice1.start) )
 
 # This function was for sorting dictionary keys by the second tuple element.
 # (We now use the Schwartzian transform instead for efficiency.)

Modified: trunk/scipy/sparse/sparsetools/sparsetools.h
===================================================================
--- trunk/scipy/sparse/sparsetools/sparsetools.h	2007-09-04 22:08:22 UTC (rev 3301)
+++ trunk/scipy/sparse/sparsetools/sparsetools.h	2007-09-05 15:59:21 UTC (rev 3302)
@@ -858,7 +858,60 @@
     }    
 }
 
+template<class I, class T>
+void get_csr_submatrix(const I n_row,
+		       const I n_col,
+		       const I Ap[], 
+		       const I Aj[], 
+		       const T Ax[],
+		       const I ir0,
+		       const I ir1,
+		       const I ic0,
+		       const I ic1,
+		       std::vector<I>* Bp,
+		       std::vector<I>* Bj,
+		       std::vector<T>* Bx)
+{
+  I new_n_row = ir1 - ir0;
+  I new_n_col = ic1 - ic0;
+  I new_nnz = 0;
+  I kk = 0;
 
+  // Count nonzeros total/per row.
+  for(I i = 0; i < new_n_row; i++){
+    I row_start = Ap[ir0+i];
+    I row_end   = Ap[ir0+i+1];
+
+    for(I jj = row_start; jj < row_end; jj++){
+      if ((Aj[jj] >= ic0) && (Aj[jj] < ic1)) {
+	new_nnz++;
+      }
+    }
+  }
+
+  // Allocate.
+  Bp->resize(new_n_row+1);
+  Bj->resize(new_nnz);
+  Bx->resize(new_nnz);
+
+  // Assign.
+  (*Bp)[0] = 0;
+  for(I i = 0; i < new_n_row; i++){
+    I row_start = Ap[ir0+i];
+    I row_end   = Ap[ir0+i+1];
+
+    for(I jj = row_start; jj < row_end; jj++){
+      if ((Aj[jj] >= ic0) && (Aj[jj] < ic1)) {
+	(*Bj)[kk] = Aj[jj] - ic0;
+	(*Bx)[kk] = Ax[jj];
+	kk++;
+      }
+    }
+    (*Bp)[i+1] = kk;
+  }
+}
+
+
 /*
  * Derived methods
  */

Modified: trunk/scipy/sparse/sparsetools/sparsetools.i
===================================================================
--- trunk/scipy/sparse/sparsetools/sparsetools.i	2007-09-04 22:08:22 UTC (rev 3301)
+++ trunk/scipy/sparse/sparsetools/sparsetools.i	2007-09-05 15:59:21 UTC (rev 3302)
@@ -244,10 +244,11 @@
 INSTANTIATE_ALL(sort_csr_indices)
 INSTANTIATE_ALL(sort_csc_indices)
 
+
 /*
  * Sum duplicate CSR/CSC entries.
  */
 INSTANTIATE_ALL(sum_csr_duplicates)
 INSTANTIATE_ALL(sum_csc_duplicates)
 
-
+INSTANTIATE_ALL(get_csr_submatrix)

Modified: trunk/scipy/sparse/sparsetools/sparsetools.py
===================================================================
--- trunk/scipy/sparse/sparsetools/sparsetools.py	2007-09-04 22:08:22 UTC (rev 3301)
+++ trunk/scipy/sparse/sparsetools/sparsetools.py	2007-09-05 15:59:21 UTC (rev 3302)
@@ -1,5 +1,5 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.32
+# Version 1.3.31
 #
 # Don't modify this file, modify the SWIG interface instead.
 # This file is compatible with both classic and new-style classes.
@@ -579,3 +579,28 @@
     """
   return _sparsetools.sum_csc_duplicates(*args)
 
+def get_csr_submatrix(*args):
+  """
+    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, int Ax, int ir0, 
+        int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
+        std::vector<(int)> Bj, std::vector<(int)> Bx)
+    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, long Ax, int ir0, 
+        int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
+        std::vector<(int)> Bj, std::vector<(long)> Bx)
+    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, float Ax, int ir0, 
+        int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
+        std::vector<(int)> Bj, std::vector<(float)> Bx)
+    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, double Ax, int ir0, 
+        int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
+        std::vector<(int)> Bj, std::vector<(double)> Bx)
+    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
+        int ir0, int ir1, int ic0, int ic1, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(npy_cfloat_wrapper)> Bx)
+    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
+        int ir0, int ir1, int ic0, int ic1, 
+        std::vector<(int)> Bp, std::vector<(int)> Bj, 
+        std::vector<(npy_cdouble_wrapper)> Bx)
+    """
+  return _sparsetools.get_csr_submatrix(*args)
+

Modified: trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx
===================================================================
--- trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx	2007-09-04 22:08:22 UTC (rev 3301)
+++ trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx	2007-09-05 15:59:21 UTC (rev 3302)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.32
+ * Version 1.3.31
  * 
  * 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
@@ -34,14 +34,14 @@
 
 /* template workaround for compilers that cannot correctly implement the C++ standard */
 #ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-#  define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-#  define SWIGTEMPLATEDISAMBIGUATOR template
+# if defined(__SUNPRO_CC)
+#   if (__SUNPRO_CC <= 0x560)
+#     define SWIGTEMPLATEDISAMBIGUATOR template
+#   else
+#     define SWIGTEMPLATEDISAMBIGUATOR 
+#   endif
 # else
-#  define SWIGTEMPLATEDISAMBIGUATOR
+#   define SWIGTEMPLATEDISAMBIGUATOR 
 # endif
 #endif
 
@@ -1608,11 +1608,9 @@
     (unaryfunc)0,                 /*nb_float*/
     (unaryfunc)PySwigObject_oct,  /*nb_oct*/
     (unaryfunc)PySwigObject_hex,  /*nb_hex*/
-#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
-    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
-#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
-    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 /* 2.0.0 */
+#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
   };
@@ -2495,7 +2493,7 @@
 
 #define SWIG_name    "_sparsetools"
 
-#define SWIGVERSION 0x010332 
+#define SWIGVERSION 0x010331 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -30399,455 +30397,1336 @@
 }
 
 
+SWIGINTERN PyObject *_wrap_get_csr_submatrix__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  int *arg5 ;
+  int arg6 ;
+  int arg7 ;
+  int arg8 ;
+  int arg9 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg11 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg12 = (std::vector<int > *) 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 ;
+  int val6 ;
+  int ecode6 = 0 ;
+  int val7 ;
+  int ecode7 = 0 ;
+  int val8 ;
+  int ecode8 = 0 ;
+  int val9 ;
+  int ecode9 = 0 ;
+  std::vector<int > *tmp10 ;
+  std::vector<int > *tmp11 ;
+  std::vector<int > *tmp12 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<int>(); 
+    arg11 = tmp11; 
+  }
+  {
+    tmp12 = new std::vector<int>(); 
+    arg12 = tmp12; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:get_csr_submatrix",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_csr_submatrix" "', 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 '" "get_csr_submatrix" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp 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;
+  }
+  ecode6 = SWIG_AsVal_int(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "get_csr_submatrix" "', argument " "6"" of type '" "int""'");
+  } 
+  arg6 = static_cast< int >(val6);
+  ecode7 = SWIG_AsVal_int(obj6, &val7);
+  if (!SWIG_IsOK(ecode7)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "get_csr_submatrix" "', argument " "7"" of type '" "int""'");
+  } 
+  arg7 = static_cast< int >(val7);
+  ecode8 = SWIG_AsVal_int(obj7, &val8);
+  if (!SWIG_IsOK(ecode8)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "get_csr_submatrix" "', argument " "8"" of type '" "int""'");
+  } 
+  arg8 = static_cast< int >(val8);
+  ecode9 = SWIG_AsVal_int(obj8, &val9);
+  if (!SWIG_IsOK(ecode9)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'");
+  } 
+  arg9 = static_cast< int >(val9);
+  get_csr_submatrix<int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
+  resultobj = SWIG_Py_Void();
+  {
+    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_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(int)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg12)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length,PyArray_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg12))[0]),sizeof(int)*length);	 
+    delete arg12; 
+    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_get_csr_submatrix__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  long *arg5 ;
+  int arg6 ;
+  int arg7 ;
+  int arg8 ;
+  int arg9 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg11 = (std::vector<int > *) 0 ;
+  std::vector<long > *arg12 = (std::vector<long > *) 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 ;
+  int val6 ;
+  int ecode6 = 0 ;
+  int val7 ;
+  int ecode7 = 0 ;
+  int val8 ;
+  int ecode8 = 0 ;
+  int val9 ;
+  int ecode9 = 0 ;
+  std::vector<int > *tmp10 ;
+  std::vector<int > *tmp11 ;
+  std::vector<long > *tmp12 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<int>(); 
+    arg11 = tmp11; 
+  }
+  {
+    tmp12 = new std::vector<long>(); 
+    arg12 = tmp12; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:get_csr_submatrix",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_csr_submatrix" "', 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 '" "get_csr_submatrix" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp size[1] = {
+      -1
+    };
+    array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_LONG, &is_new_object5);
+    if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1)) SWIG_fail;
+    arg5 = (long*) array5->data;
+  }
+  ecode6 = SWIG_AsVal_int(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "get_csr_submatrix" "', argument " "6"" of type '" "int""'");
+  } 
+  arg6 = static_cast< int >(val6);
+  ecode7 = SWIG_AsVal_int(obj6, &val7);
+  if (!SWIG_IsOK(ecode7)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "get_csr_submatrix" "', argument " "7"" of type '" "int""'");
+  } 
+  arg7 = static_cast< int >(val7);
+  ecode8 = SWIG_AsVal_int(obj7, &val8);
+  if (!SWIG_IsOK(ecode8)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "get_csr_submatrix" "', argument " "8"" of type '" "int""'");
+  } 
+  arg8 = static_cast< int >(val8);
+  ecode9 = SWIG_AsVal_int(obj8, &val9);
+  if (!SWIG_IsOK(ecode9)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'");
+  } 
+  arg9 = static_cast< int >(val9);
+  get_csr_submatrix<int,long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
+  resultobj = SWIG_Py_Void();
+  {
+    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_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(int)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg12)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length,PyArray_LONG); 
+    memcpy(PyArray_DATA(obj),&((*(arg12))[0]),sizeof(long)*length);	 
+    delete arg12; 
+    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_get_csr_submatrix__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  float *arg5 ;
+  int arg6 ;
+  int arg7 ;
+  int arg8 ;
+  int arg9 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg11 = (std::vector<int > *) 0 ;
+  std::vector<float > *arg12 = (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 ;
+  int val6 ;
+  int ecode6 = 0 ;
+  int val7 ;
+  int ecode7 = 0 ;
+  int val8 ;
+  int ecode8 = 0 ;
+  int val9 ;
+  int ecode9 = 0 ;
+  std::vector<int > *tmp10 ;
+  std::vector<int > *tmp11 ;
+  std::vector<float > *tmp12 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<int>(); 
+    arg11 = tmp11; 
+  }
+  {
+    tmp12 = new std::vector<float>(); 
+    arg12 = tmp12; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:get_csr_submatrix",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_csr_submatrix" "', 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 '" "get_csr_submatrix" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp 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;
+  }
+  ecode6 = SWIG_AsVal_int(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "get_csr_submatrix" "', argument " "6"" of type '" "int""'");
+  } 
+  arg6 = static_cast< int >(val6);
+  ecode7 = SWIG_AsVal_int(obj6, &val7);
+  if (!SWIG_IsOK(ecode7)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "get_csr_submatrix" "', argument " "7"" of type '" "int""'");
+  } 
+  arg7 = static_cast< int >(val7);
+  ecode8 = SWIG_AsVal_int(obj7, &val8);
+  if (!SWIG_IsOK(ecode8)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "get_csr_submatrix" "', argument " "8"" of type '" "int""'");
+  } 
+  arg8 = static_cast< int >(val8);
+  ecode9 = SWIG_AsVal_int(obj8, &val9);
+  if (!SWIG_IsOK(ecode9)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'");
+  } 
+  arg9 = static_cast< int >(val9);
+  get_csr_submatrix<int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
+  resultobj = SWIG_Py_Void();
+  {
+    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_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(int)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg12)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length,PyArray_FLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg12))[0]),sizeof(float)*length);	 
+    delete arg12; 
+    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_get_csr_submatrix__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  double *arg5 ;
+  int arg6 ;
+  int arg7 ;
+  int arg8 ;
+  int arg9 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg11 = (std::vector<int > *) 0 ;
+  std::vector<double > *arg12 = (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 ;
+  int val6 ;
+  int ecode6 = 0 ;
+  int val7 ;
+  int ecode7 = 0 ;
+  int val8 ;
+  int ecode8 = 0 ;
+  int val9 ;
+  int ecode9 = 0 ;
+  std::vector<int > *tmp10 ;
+  std::vector<int > *tmp11 ;
+  std::vector<double > *tmp12 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<int>(); 
+    arg11 = tmp11; 
+  }
+  {
+    tmp12 = new std::vector<double>(); 
+    arg12 = tmp12; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:get_csr_submatrix",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_csr_submatrix" "', 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 '" "get_csr_submatrix" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp 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;
+  }
+  ecode6 = SWIG_AsVal_int(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "get_csr_submatrix" "', argument " "6"" of type '" "int""'");
+  } 
+  arg6 = static_cast< int >(val6);
+  ecode7 = SWIG_AsVal_int(obj6, &val7);
+  if (!SWIG_IsOK(ecode7)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "get_csr_submatrix" "', argument " "7"" of type '" "int""'");
+  } 
+  arg7 = static_cast< int >(val7);
+  ecode8 = SWIG_AsVal_int(obj7, &val8);
+  if (!SWIG_IsOK(ecode8)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "get_csr_submatrix" "', argument " "8"" of type '" "int""'");
+  } 
+  arg8 = static_cast< int >(val8);
+  ecode9 = SWIG_AsVal_int(obj8, &val9);
+  if (!SWIG_IsOK(ecode9)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'");
+  } 
+  arg9 = static_cast< int >(val9);
+  get_csr_submatrix<int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
+  resultobj = SWIG_Py_Void();
+  {
+    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_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(int)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg12)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length,PyArray_DOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg12))[0]),sizeof(double)*length);	 
+    delete arg12; 
+    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_get_csr_submatrix__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cfloat_wrapper *arg5 ;
+  int arg6 ;
+  int arg7 ;
+  int arg8 ;
+  int arg9 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg11 = (std::vector<int > *) 0 ;
+  std::vector<npy_cfloat_wrapper > *arg12 = (std::vector<npy_cfloat_wrapper > *) 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 ;
+  int val6 ;
+  int ecode6 = 0 ;
+  int val7 ;
+  int ecode7 = 0 ;
+  int val8 ;
+  int ecode8 = 0 ;
+  int val9 ;
+  int ecode9 = 0 ;
+  std::vector<int > *tmp10 ;
+  std::vector<int > *tmp11 ;
+  std::vector<npy_cfloat_wrapper > *tmp12 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<int>(); 
+    arg11 = tmp11; 
+  }
+  {
+    tmp12 = new std::vector<npy_cfloat_wrapper>(); 
+    arg12 = tmp12; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:get_csr_submatrix",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_csr_submatrix" "', 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 '" "get_csr_submatrix" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp 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_wrapper*) array5->data;
+  }
+  ecode6 = SWIG_AsVal_int(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "get_csr_submatrix" "', argument " "6"" of type '" "int""'");
+  } 
+  arg6 = static_cast< int >(val6);
+  ecode7 = SWIG_AsVal_int(obj6, &val7);
+  if (!SWIG_IsOK(ecode7)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "get_csr_submatrix" "', argument " "7"" of type '" "int""'");
+  } 
+  arg7 = static_cast< int >(val7);
+  ecode8 = SWIG_AsVal_int(obj7, &val8);
+  if (!SWIG_IsOK(ecode8)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "get_csr_submatrix" "', argument " "8"" of type '" "int""'");
+  } 
+  arg8 = static_cast< int >(val8);
+  ecode9 = SWIG_AsVal_int(obj8, &val9);
+  if (!SWIG_IsOK(ecode9)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'");
+  } 
+  arg9 = static_cast< int >(val9);
+  get_csr_submatrix<int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
+  resultobj = SWIG_Py_Void();
+  {
+    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_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(int)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg12)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length,PyArray_CFLOAT); 
+    memcpy(PyArray_DATA(obj),&((*(arg12))[0]),sizeof(npy_cfloat_wrapper)*length);	 
+    delete arg12; 
+    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_get_csr_submatrix__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 ;
+  int *arg4 ;
+  npy_cdouble_wrapper *arg5 ;
+  int arg6 ;
+  int arg7 ;
+  int arg8 ;
+  int arg9 ;
+  std::vector<int > *arg10 = (std::vector<int > *) 0 ;
+  std::vector<int > *arg11 = (std::vector<int > *) 0 ;
+  std::vector<npy_cdouble_wrapper > *arg12 = (std::vector<npy_cdouble_wrapper > *) 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 ;
+  int val6 ;
+  int ecode6 = 0 ;
+  int val7 ;
+  int ecode7 = 0 ;
+  int val8 ;
+  int ecode8 = 0 ;
+  int val9 ;
+  int ecode9 = 0 ;
+  std::vector<int > *tmp10 ;
+  std::vector<int > *tmp11 ;
+  std::vector<npy_cdouble_wrapper > *tmp12 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  
+  {
+    tmp10 = new std::vector<int>(); 
+    arg10 = tmp10; 
+  }
+  {
+    tmp11 = new std::vector<int>(); 
+    arg11 = tmp11; 
+  }
+  {
+    tmp12 = new std::vector<npy_cdouble_wrapper>(); 
+    arg12 = tmp12; 
+  }
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:get_csr_submatrix",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_csr_submatrix" "', 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 '" "get_csr_submatrix" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp 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;
+  }
+  {
+    npy_intp 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_wrapper*) array5->data;
+  }
+  ecode6 = SWIG_AsVal_int(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "get_csr_submatrix" "', argument " "6"" of type '" "int""'");
+  } 
+  arg6 = static_cast< int >(val6);
+  ecode7 = SWIG_AsVal_int(obj6, &val7);
+  if (!SWIG_IsOK(ecode7)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "get_csr_submatrix" "', argument " "7"" of type '" "int""'");
+  } 
+  arg7 = static_cast< int >(val7);
+  ecode8 = SWIG_AsVal_int(obj7, &val8);
+  if (!SWIG_IsOK(ecode8)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "get_csr_submatrix" "', argument " "8"" of type '" "int""'");
+  } 
+  arg8 = static_cast< int >(val8);
+  ecode9 = SWIG_AsVal_int(obj8, &val9);
+  if (!SWIG_IsOK(ecode9)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'");
+  } 
+  arg9 = static_cast< int >(val9);
+  get_csr_submatrix<int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
+  resultobj = SWIG_Py_Void();
+  {
+    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_INT); 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(int)*length);	 
+    delete arg11; 
+    resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
+  }
+  {
+    int length = (arg12)->size(); 
+    PyObject *obj = PyArray_FromDims(1, &length,PyArray_CDOUBLE); 
+    memcpy(PyArray_DATA(obj),&((*(arg12))[0]),sizeof(npy_cdouble_wrapper)*length);	 
+    delete arg12; 
+    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_get_csr_submatrix(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[10];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = PyObject_Length(args);
+  for (ii = 0; (ii < argc) && (ii < 9); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 9) {
+    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_INT)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                int res = SWIG_AsVal_int(argv[5], NULL);
+                _v = SWIG_CheckState(res);
+              }
+              if (_v) {
+                {
+                  int res = SWIG_AsVal_int(argv[6], NULL);
+                  _v = SWIG_CheckState(res);
+                }
+                if (_v) {
+                  {
+                    int res = SWIG_AsVal_int(argv[7], NULL);
+                    _v = SWIG_CheckState(res);
+                  }
+                  if (_v) {
+                    {
+                      int res = SWIG_AsVal_int(argv[8], NULL);
+                      _v = SWIG_CheckState(res);
+                    }
+                    if (_v) {
+                      return _wrap_get_csr_submatrix__SWIG_1(self, args);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 9) {
+    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_LONG)) ? 1 : 0;
+            }
+            if (_v) {
+              {
+                int res = SWIG_AsVal_int(argv[5], NULL);
+                _v = SWIG_CheckState(res);
+              }
+              if (_v) {
+                {
+                  int res = SWIG_AsVal_int(argv[6], NULL);
+                  _v = SWIG_CheckState(res);
+                }
+                if (_v) {
+                  {
+                    int res = SWIG_AsVal_int(argv[7], NULL);
+                    _v = SWIG_CheckState(res);
+                  }
+                  if (_v) {
+                    {
+                      int res = SWIG_AsVal_int(argv[8], NULL);
+                      _v = SWIG_CheckState(res);
+                    }
+                    if (_v) {
+                      return _wrap_get_csr_submatrix__SWIG_2(self, args);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 9) {
+    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) {
+              {
+                int res = SWIG_AsVal_int(argv[5], NULL);
+                _v = SWIG_CheckState(res);
+              }
+              if (_v) {
+                {
+                  int res = SWIG_AsVal_int(argv[6], NULL);
+                  _v = SWIG_CheckState(res);
+                }
+                if (_v) {
+                  {
+                    int res = SWIG_AsVal_int(argv[7], NULL);
+                    _v = SWIG_CheckState(res);
+                  }
+                  if (_v) {
+                    {
+                      int res = SWIG_AsVal_int(argv[8], NULL);
+                      _v = SWIG_CheckState(res);
+                    }
+                    if (_v) {
+                      return _wrap_get_csr_submatrix__SWIG_3(self, args);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 9) {
+    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) {
+              {
+                int res = SWIG_AsVal_int(argv[5], NULL);
+                _v = SWIG_CheckState(res);
+              }
+              if (_v) {
+                {
+                  int res = SWIG_AsVal_int(argv[6], NULL);
+                  _v = SWIG_CheckState(res);
+                }
+                if (_v) {
+                  {
+                    int res = SWIG_AsVal_int(argv[7], NULL);
+                    _v = SWIG_CheckState(res);
+                  }
+                  if (_v) {
+                    {
+                      int res = SWIG_AsVal_int(argv[8], NULL);
+                      _v = SWIG_CheckState(res);
+                    }
+                    if (_v) {
+                      return _wrap_get_csr_submatrix__SWIG_4(self, args);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 9) {
+    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) {
+              {
+                int res = SWIG_AsVal_int(argv[5], NULL);
+                _v = SWIG_CheckState(res);
+              }
+              if (_v) {
+                {
+                  int res = SWIG_AsVal_int(argv[6], NULL);
+                  _v = SWIG_CheckState(res);
+                }
+                if (_v) {
+                  {
+                    int res = SWIG_AsVal_int(argv[7], NULL);
+                    _v = SWIG_CheckState(res);
+                  }
+                  if (_v) {
+                    {
+                      int res = SWIG_AsVal_int(argv[8], NULL);
+                      _v = SWIG_CheckState(res);
+                    }
+                    if (_v) {
+                      return _wrap_get_csr_submatrix__SWIG_5(self, args);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  if (argc == 9) {
+    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) {
+              {
+                int res = SWIG_AsVal_int(argv[5], NULL);
+                _v = SWIG_CheckState(res);
+              }
+              if (_v) {
+                {
+                  int res = SWIG_AsVal_int(argv[6], NULL);
+                  _v = SWIG_CheckState(res);
+                }
+                if (_v) {
+                  {
+                    int res = SWIG_AsVal_int(argv[7], NULL);
+                    _v = SWIG_CheckState(res);
+                  }
+                  if (_v) {
+                    {
+                      int res = SWIG_AsVal_int(argv[8], NULL);
+                      _v = SWIG_CheckState(res);
+                    }
+                    if (_v) {
+                      return _wrap_get_csr_submatrix__SWIG_6(self, args);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'get_csr_submatrix'.\n  Possible C/C++ prototypes are:\n    get_csr_submatrix<(int,int)>(int const,int const,int const [],int const [],int const [],int const,int const,int const,int const,std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    get_csr_submatrix<(int,long)>(int const,int const,int const [],int const [],long const [],int const,int const,int const,int const,std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    get_csr_submatrix<(int,float)>(int const,int const,int const [],int const [],float const [],int const,int const,int const,int const,std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    get_csr_submatrix<(int,double)>(int const,int const,int const [],int const [],double const [],int const,int const,int const,int const,std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    get_csr_submatrix<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const,int const,int const,int const,std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat_wrapper > *)\n    get_csr_submatrix<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const,int const,int const,int const,std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble_wrapper > *)\n");
+  return NULL;
+}
+
+
 static PyMethodDef SwigMethods[] = {
-	 { (char *)"extract_csr_diagonal", _wrap_extract_csr_diagonal, METH_VARARGS, (char *)"\n"
-		"extract_csr_diagonal(int n_row, int n_col, int Ap, int Aj, int Ax, std::vector<(int)> Yx)\n"
-		"extract_csr_diagonal(int n_row, int n_col, int Ap, int Aj, long Ax, std::vector<(long)> Yx)\n"
-		"extract_csr_diagonal(int n_row, int n_col, int Ap, int Aj, float Ax, std::vector<(float)> Yx)\n"
-		"extract_csr_diagonal(int n_row, int n_col, int Ap, int Aj, double Ax, std::vector<(double)> Yx)\n"
-		"extract_csr_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Yx)\n"
-		"extract_csr_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Yx)\n"
-		""},
-	 { (char *)"extract_csc_diagonal", _wrap_extract_csc_diagonal, METH_VARARGS, (char *)"\n"
-		"extract_csc_diagonal(int n_row, int n_col, int Ap, int Aj, int Ax, std::vector<(int)> Yx)\n"
-		"extract_csc_diagonal(int n_row, int n_col, int Ap, int Aj, long Ax, std::vector<(long)> Yx)\n"
-		"extract_csc_diagonal(int n_row, int n_col, int Ap, int Aj, float Ax, std::vector<(float)> Yx)\n"
-		"extract_csc_diagonal(int n_row, int n_col, int Ap, int Aj, double Ax, std::vector<(double)> Yx)\n"
-		"extract_csc_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Yx)\n"
-		"extract_csc_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Yx)\n"
-		""},
-	 { (char *)"csrtocsc", _wrap_csrtocsc, METH_VARARGS, (char *)"\n"
-		"csrtocsc(int n_row, int n_col, int Ap, int Aj, int Ax, std::vector<(int)> Bp, \n"
-		"    std::vector<(int)> Bi, std::vector<(int)> Bx)\n"
-		"csrtocsc(int n_row, int n_col, int Ap, int Aj, long Ax, std::vector<(int)> Bp, \n"
-		"    std::vector<(int)> Bi, std::vector<(long)> Bx)\n"
-		"csrtocsc(int n_row, int n_col, int Ap, int Aj, float Ax, std::vector<(int)> Bp, \n"
-		"    std::vector<(int)> Bi, std::vector<(float)> Bx)\n"
-		"csrtocsc(int n_row, int n_col, int Ap, int Aj, double Ax, std::vector<(int)> Bp, \n"
-		"    std::vector<(int)> Bi, std::vector<(double)> Bx)\n"
-		"csrtocsc(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bi, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Bx)\n"
-		"csrtocsc(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bi, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Bx)\n"
-		""},
-	 { (char *)"csctocsr", _wrap_csctocsr, METH_VARARGS, (char *)"\n"
-		"csctocsr(int n_row, int n_col, int Ap, int Ai, int Ax, std::vector<(int)> Bp, \n"
-		"    std::vector<(int)> Bj, std::vector<(int)> Bx)\n"
-		"csctocsr(int n_row, int n_col, int Ap, int Ai, long Ax, std::vector<(int)> Bp, \n"
-		"    std::vector<(int)> Bj, std::vector<(long)> Bx)\n"
-		"csctocsr(int n_row, int n_col, int Ap, int Ai, float Ax, std::vector<(int)> Bp, \n"
-		"    std::vector<(int)> Bj, std::vector<(float)> Bx)\n"
-		"csctocsr(int n_row, int n_col, int Ap, int Ai, double Ax, std::vector<(int)> Bp, \n"
-		"    std::vector<(int)> Bj, std::vector<(double)> Bx)\n"
-		"csctocsr(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bj, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Bx)\n"
-		"csctocsr(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bj, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Bx)\n"
-		""},
-	 { (char *)"csrtocoo", _wrap_csrtocoo, METH_VARARGS, (char *)"\n"
-		"csrtocoo(int n_row, int n_col, int Ap, int Aj, int Ax, std::vector<(int)> Bi, \n"
-		"    std::vector<(int)> Bj, std::vector<(int)> Bx)\n"
-		"csrtocoo(int n_row, int n_col, int Ap, int Aj, long Ax, std::vector<(int)> Bi, \n"
-		"    std::vector<(int)> Bj, std::vector<(long)> Bx)\n"
-		"csrtocoo(int n_row, int n_col, int Ap, int Aj, float Ax, std::vector<(int)> Bi, \n"
-		"    std::vector<(int)> Bj, std::vector<(float)> Bx)\n"
-		"csrtocoo(int n_row, int n_col, int Ap, int Aj, double Ax, std::vector<(int)> Bi, \n"
-		"    std::vector<(int)> Bj, std::vector<(double)> Bx)\n"
-		"csrtocoo(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    std::vector<(int)> Bi, std::vector<(int)> Bj, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Bx)\n"
-		"csrtocoo(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    std::vector<(int)> Bi, std::vector<(int)> Bj, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Bx)\n"
-		""},
-	 { (char *)"csctocoo", _wrap_csctocoo, METH_VARARGS, (char *)"\n"
-		"csctocoo(int n_row, int n_col, int Ap, int Ai, int Ax, std::vector<(int)> Bi, \n"
-		"    std::vector<(int)> Bj, std::vector<(int)> Bx)\n"
-		"csctocoo(int n_row, int n_col, int Ap, int Ai, long Ax, std::vector<(int)> Bi, \n"
-		"    std::vector<(int)> Bj, std::vector<(long)> Bx)\n"
-		"csctocoo(int n_row, int n_col, int Ap, int Ai, float Ax, std::vector<(int)> Bi, \n"
-		"    std::vector<(int)> Bj, std::vector<(float)> Bx)\n"
-		"csctocoo(int n_row, int n_col, int Ap, int Ai, double Ax, std::vector<(int)> Bi, \n"
-		"    std::vector<(int)> Bj, std::vector<(double)> Bx)\n"
-		"csctocoo(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, \n"
-		"    std::vector<(int)> Bi, std::vector<(int)> Bj, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Bx)\n"
-		"csctocoo(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, \n"
-		"    std::vector<(int)> Bi, std::vector<(int)> Bj, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Bx)\n"
-		""},
-	 { (char *)"cootocsr", _wrap_cootocsr, METH_VARARGS, (char *)"\n"
-		"cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, int Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bj, \n"
-		"    std::vector<(int)> Bx)\n"
-		"cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, long Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bj, \n"
-		"    std::vector<(long)> Bx)\n"
-		"cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, float Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bj, \n"
-		"    std::vector<(float)> Bx)\n"
-		"cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, double Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bj, \n"
-		"    std::vector<(double)> Bx)\n"
-		"cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bj, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Bx)\n"
-		"cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bj, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Bx)\n"
-		""},
-	 { (char *)"cootocsc", _wrap_cootocsc, METH_VARARGS, (char *)"\n"
-		"cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, int Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bi, \n"
-		"    std::vector<(int)> Bx)\n"
-		"cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, long Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bi, \n"
-		"    std::vector<(long)> Bx)\n"
-		"cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, float Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bi, \n"
-		"    std::vector<(float)> Bx)\n"
-		"cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, double Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bi, \n"
-		"    std::vector<(double)> Bx)\n"
-		"cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bi, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Bx)\n"
-		"cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    std::vector<(int)> Bp, std::vector<(int)> Bi, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Bx)\n"
-		""},
-	 { (char *)"csrmucsr", _wrap_csrmucsr, METH_VARARGS, (char *)"\n"
-		"csrmucsr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp, \n"
-		"    int Bj, int Bx, std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(int)> Cx)\n"
-		"csrmucsr(int n_row, int n_col, int Ap, int Aj, long Ax, int Bp, \n"
-		"    int Bj, long Bx, std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(long)> Cx)\n"
-		"csrmucsr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, \n"
-		"    int Bj, float Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Cj, std::vector<(float)> Cx)\n"
-		"csrmucsr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, \n"
-		"    int Bj, double Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Cj, std::vector<(double)> Cx)\n"
-		"csrmucsr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    int Bp, int Bj, npy_cfloat_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Cx)\n"
-		"csrmucsr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    int Bp, int Bj, npy_cdouble_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Cx)\n"
-		""},
-	 { (char *)"cscmucsc", _wrap_cscmucsc, METH_VARARGS, (char *)"\n"
-		"cscmucsc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp, \n"
-		"    int Bi, int Bx, std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(int)> Cx)\n"
-		"cscmucsc(int n_row, int n_col, int Ap, int Ai, long Ax, int Bp, \n"
-		"    int Bi, long Bx, std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(long)> Cx)\n"
-		"cscmucsc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, \n"
-		"    int Bi, float Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Ci, std::vector<(float)> Cx)\n"
-		"cscmucsc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, \n"
-		"    int Bi, double Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Ci, std::vector<(double)> Cx)\n"
-		"cscmucsc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, \n"
-		"    int Bp, int Bi, npy_cfloat_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Cx)\n"
-		"cscmucsc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, \n"
-		"    int Bp, int Bi, npy_cdouble_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Cx)\n"
-		""},
-	 { (char *)"csrmux", _wrap_csrmux, METH_VARARGS, (char *)"\n"
-		"csrmux(int n_row, int n_col, int Ap, int Aj, int Ax, int Xx, \n"
-		"    std::vector<(int)> Yx)\n"
-		"csrmux(int n_row, int n_col, int Ap, int Aj, long Ax, long Xx, \n"
-		"    std::vector<(long)> Yx)\n"
-		"csrmux(int n_row, int n_col, int Ap, int Aj, float Ax, float Xx, \n"
-		"    std::vector<(float)> Yx)\n"
-		"csrmux(int n_row, int n_col, int Ap, int Aj, double Ax, double Xx, \n"
-		"    std::vector<(double)> Yx)\n"
-		"csrmux(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    npy_cfloat_wrapper Xx, std::vector<(npy_cfloat_wrapper)> Yx)\n"
-		"csrmux(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    npy_cdouble_wrapper Xx, std::vector<(npy_cdouble_wrapper)> Yx)\n"
-		""},
-	 { (char *)"cscmux", _wrap_cscmux, METH_VARARGS, (char *)"\n"
-		"cscmux(int n_row, int n_col, int Ap, int Ai, int Ax, int Xx, \n"
-		"    std::vector<(int)> Yx)\n"
-		"cscmux(int n_row, int n_col, int Ap, int Ai, long Ax, long Xx, \n"
-		"    std::vector<(long)> Yx)\n"
-		"cscmux(int n_row, int n_col, int Ap, int Ai, float Ax, float Xx, \n"
-		"    std::vector<(float)> Yx)\n"
-		"cscmux(int n_row, int n_col, int Ap, int Ai, double Ax, double Xx, \n"
-		"    std::vector<(double)> Yx)\n"
-		"cscmux(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, \n"
-		"    npy_cfloat_wrapper Xx, std::vector<(npy_cfloat_wrapper)> Yx)\n"
-		"cscmux(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, \n"
-		"    npy_cdouble_wrapper Xx, std::vector<(npy_cdouble_wrapper)> Yx)\n"
-		""},
-	 { (char *)"csr_elmul_csr", _wrap_csr_elmul_csr, METH_VARARGS, (char *)"\n"
-		"csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp, \n"
-		"    int Bj, int Bx, std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(int)> Cx)\n"
-		"csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, long Ax, int Bp, \n"
-		"    int Bj, long Bx, std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(long)> Cx)\n"
-		"csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, \n"
-		"    int Bj, float Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Cj, std::vector<(float)> Cx)\n"
-		"csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, \n"
-		"    int Bj, double Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Cj, std::vector<(double)> Cx)\n"
-		"csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    int Bp, int Bj, npy_cfloat_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Cx)\n"
-		"csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    int Bp, int Bj, npy_cdouble_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Cx)\n"
-		""},
-	 { (char *)"csr_eldiv_csr", _wrap_csr_eldiv_csr, METH_VARARGS, (char *)"\n"
-		"csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp, \n"
-		"    int Bj, int Bx, std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(int)> Cx)\n"
-		"csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, long Ax, int Bp, \n"
-		"    int Bj, long Bx, std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(long)> Cx)\n"
-		"csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, \n"
-		"    int Bj, float Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Cj, std::vector<(float)> Cx)\n"
-		"csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, \n"
-		"    int Bj, double Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Cj, std::vector<(double)> Cx)\n"
-		"csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    int Bp, int Bj, npy_cfloat_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Cx)\n"
-		"csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    int Bp, int Bj, npy_cdouble_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Cx)\n"
-		""},
-	 { (char *)"csr_plus_csr", _wrap_csr_plus_csr, METH_VARARGS, (char *)"\n"
-		"csr_plus_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp, \n"
-		"    int Bj, int Bx, std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(int)> Cx)\n"
-		"csr_plus_csr(int n_row, int n_col, int Ap, int Aj, long Ax, int Bp, \n"
-		"    int Bj, long Bx, std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(long)> Cx)\n"
-		"csr_plus_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, \n"
-		"    int Bj, float Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Cj, std::vector<(float)> Cx)\n"
-		"csr_plus_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, \n"
-		"    int Bj, double Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Cj, std::vector<(double)> Cx)\n"
-		"csr_plus_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    int Bp, int Bj, npy_cfloat_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Cx)\n"
-		"csr_plus_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    int Bp, int Bj, npy_cdouble_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Cx)\n"
-		""},
-	 { (char *)"csr_minus_csr", _wrap_csr_minus_csr, METH_VARARGS, (char *)"\n"
-		"csr_minus_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp, \n"
-		"    int Bj, int Bx, std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(int)> Cx)\n"
-		"csr_minus_csr(int n_row, int n_col, int Ap, int Aj, long Ax, int Bp, \n"
-		"    int Bj, long Bx, std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(long)> Cx)\n"
-		"csr_minus_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, \n"
-		"    int Bj, float Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Cj, std::vector<(float)> Cx)\n"
-		"csr_minus_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, \n"
-		"    int Bj, double Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Cj, std::vector<(double)> Cx)\n"
-		"csr_minus_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    int Bp, int Bj, npy_cfloat_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Cx)\n"
-		"csr_minus_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    int Bp, int Bj, npy_cdouble_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Cj, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Cx)\n"
-		""},
-	 { (char *)"csc_elmul_csc", _wrap_csc_elmul_csc, METH_VARARGS, (char *)"\n"
-		"csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp, \n"
-		"    int Bi, int Bx, std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(int)> Cx)\n"
-		"csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, long Ax, int Bp, \n"
-		"    int Bi, long Bx, std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(long)> Cx)\n"
-		"csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, \n"
-		"    int Bi, float Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Ci, std::vector<(float)> Cx)\n"
-		"csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, \n"
-		"    int Bi, double Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Ci, std::vector<(double)> Cx)\n"
-		"csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, \n"
-		"    int Bp, int Bi, npy_cfloat_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Cx)\n"
-		"csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, \n"
-		"    int Bp, int Bi, npy_cdouble_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Cx)\n"
-		""},
-	 { (char *)"csc_eldiv_csc", _wrap_csc_eldiv_csc, METH_VARARGS, (char *)"\n"
-		"csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp, \n"
-		"    int Bi, int Bx, std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(int)> Cx)\n"
-		"csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, long Ax, int Bp, \n"
-		"    int Bi, long Bx, std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(long)> Cx)\n"
-		"csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, \n"
-		"    int Bi, float Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Ci, std::vector<(float)> Cx)\n"
-		"csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, \n"
-		"    int Bi, double Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Ci, std::vector<(double)> Cx)\n"
-		"csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, \n"
-		"    int Bp, int Bi, npy_cfloat_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Cx)\n"
-		"csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, \n"
-		"    int Bp, int Bi, npy_cdouble_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Cx)\n"
-		""},
-	 { (char *)"csc_plus_csc", _wrap_csc_plus_csc, METH_VARARGS, (char *)"\n"
-		"csc_plus_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp, \n"
-		"    int Bi, int Bx, std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(int)> Cx)\n"
-		"csc_plus_csc(int n_row, int n_col, int Ap, int Ai, long Ax, int Bp, \n"
-		"    int Bi, long Bx, std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(long)> Cx)\n"
-		"csc_plus_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, \n"
-		"    int Bi, float Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Ci, std::vector<(float)> Cx)\n"
-		"csc_plus_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, \n"
-		"    int Bi, double Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Ci, std::vector<(double)> Cx)\n"
-		"csc_plus_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, \n"
-		"    int Bp, int Bi, npy_cfloat_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Cx)\n"
-		"csc_plus_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, \n"
-		"    int Bp, int Bi, npy_cdouble_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Cx)\n"
-		""},
-	 { (char *)"csc_minus_csc", _wrap_csc_minus_csc, METH_VARARGS, (char *)"\n"
-		"csc_minus_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp, \n"
-		"    int Bi, int Bx, std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(int)> Cx)\n"
-		"csc_minus_csc(int n_row, int n_col, int Ap, int Ai, long Ax, int Bp, \n"
-		"    int Bi, long Bx, std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(long)> Cx)\n"
-		"csc_minus_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, \n"
-		"    int Bi, float Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Ci, std::vector<(float)> Cx)\n"
-		"csc_minus_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, \n"
-		"    int Bi, double Bx, std::vector<(int)> Cp, \n"
-		"    std::vector<(int)> Ci, std::vector<(double)> Cx)\n"
-		"csc_minus_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, \n"
-		"    int Bp, int Bi, npy_cfloat_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(npy_cfloat_wrapper)> Cx)\n"
-		"csc_minus_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, \n"
-		"    int Bp, int Bi, npy_cdouble_wrapper Bx, \n"
-		"    std::vector<(int)> Cp, std::vector<(int)> Ci, \n"
-		"    std::vector<(npy_cdouble_wrapper)> Cx)\n"
-		""},
-	 { (char *)"spdiags", _wrap_spdiags, METH_VARARGS, (char *)"\n"
-		"spdiags(int n_row, int n_col, int n_diag, int offsets, int diags, \n"
-		"    std::vector<(int)> Ap, std::vector<(int)> Ai, \n"
-		"    std::vector<(int)> Ax)\n"
-		"spdiags(int n_row, int n_col, int n_diag, int offsets, long diags, \n"
-		"    std::vector<(int)> Ap, std::vector<(int)> Ai, \n"
-		"    std::vector<(long)> Ax)\n"
-		"spdiags(int n_row, int n_col, int n_diag, int offsets, float diags, \n"
-		"    std::vector<(int)> Ap, std::vector<(int)> Ai, \n"
-		"    std::vector<(float)> Ax)\n"
-		"spdiags(int n_row, int n_col, int n_diag, int offsets, double diags, \n"
-		"    std::vector<(int)> Ap, std::vector<(int)> Ai, \n"
-		"    std::vector<(double)> Ax)\n"
-		"spdiags(int n_row, int n_col, int n_diag, int offsets, npy_cfloat_wrapper diags, \n"
-		"    std::vector<(int)> Ap, \n"
-		"    std::vector<(int)> Ai, std::vector<(npy_cfloat_wrapper)> Ax)\n"
-		"spdiags(int n_row, int n_col, int n_diag, int offsets, npy_cdouble_wrapper diags, \n"
-		"    std::vector<(int)> Ap, \n"
-		"    std::vector<(int)> Ai, std::vector<(npy_cdouble_wrapper)> Ax)\n"
-		""},
-	 { (char *)"csrtodense", _wrap_csrtodense, METH_VARARGS, (char *)"\n"
-		"csrtodense(int n_row, int n_col, int Ap, int Aj, int Ax, int Mx)\n"
-		"csrtodense(int n_row, int n_col, int Ap, int Aj, long Ax, long Mx)\n"
-		"csrtodense(int n_row, int n_col, int Ap, int Aj, float Ax, float Mx)\n"
-		"csrtodense(int n_row, int n_col, int Ap, int Aj, double Ax, double Mx)\n"
-		"csrtodense(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n"
-		"    npy_cfloat_wrapper Mx)\n"
-		"csrtodense(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n"
-		"    npy_cdouble_wrapper Mx)\n"
-		""},
-	 { (char *)"densetocsr", _wrap_densetocsr, METH_VARARGS, (char *)"\n"
-		"densetocsr(int n_row, int n_col, int Mx, std::vector<(int)> Ap, \n"
-		"    std::vector<(int)> Aj, std::vector<(int)> Ax)\n"
-		"densetocsr(int n_row, int n_col, long Mx, std::vector<(int)> Ap, \n"
-		"    std::vector<(int)> Aj, std::vector<(long)> Ax)\n"
-		"densetocsr(int n_row, int n_col, float Mx, std::vector<(int)> Ap, \n"
-		"    std::vector<(int)> Aj, std::vector<(float)> Ax)\n"
-		"densetocsr(int n_row, int n_col, double Mx, std::vector<(int)> Ap, \n"
-		"    std::vector<(int)> Aj, std::vector<(double)> Ax)\n"
-		"densetocsr(int n_row, int n_col, npy_cfloat_wrapper Mx, std::vector<(int)> Ap, \n"
-		"    std::vector<(int)> Aj, std::vector<(npy_cfloat_wrapper)> Ax)\n"
-		"densetocsr(int n_row, int n_col, npy_cdouble_wrapper Mx, std::vector<(int)> Ap, \n"
-		"    std::vector<(int)> Aj, std::vector<(npy_cdouble_wrapper)> Ax)\n"
-		""},
-	 { (char *)"sort_csr_indices", _wrap_sort_csr_indices, METH_VARARGS, (char *)"\n"
-		"sort_csr_indices(int n_row, int n_col, int Ap, int Aj, int Ax)\n"
-		"sort_csr_indices(int n_row, int n_col, int Ap, int Aj, long Ax)\n"
-		"sort_csr_indices(int n_row, int n_col, int Ap, int Aj, float Ax)\n"
-		"sort_csr_indices(int n_row, int n_col, int Ap, int Aj, double Ax)\n"
-		"sort_csr_indices(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax)\n"
-		"sort_csr_indices(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax)\n"
-		""},
-	 { (char *)"sort_csc_indices", _wrap_sort_csc_indices, METH_VARARGS, (char *)"\n"
-		"sort_csc_indices(int n_row, int n_col, int Ap, int Ai, int Ax)\n"
-		"sort_csc_indices(int n_row, int n_col, int Ap, int Ai, long Ax)\n"
-		"sort_csc_indices(int n_row, int n_col, int Ap, int Ai, float Ax)\n"
-		"sort_csc_indices(int n_row, int n_col, int Ap, int Ai, double Ax)\n"
-		"sort_csc_indices(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax)\n"
-		"sort_csc_indices(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax)\n"
-		""},
-	 { (char *)"sum_csr_duplicates", _wrap_sum_csr_duplicates, METH_VARARGS, (char *)"\n"
-		"sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, int Ax)\n"
-		"sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, long Ax)\n"
-		"sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, float Ax)\n"
-		"sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, double Ax)\n"
-		"sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax)\n"
-		"sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax)\n"
-		""},
-	 { (char *)"sum_csc_duplicates", _wrap_sum_csc_duplicates, METH_VARARGS, (char *)"\n"
-		"sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, int Ax)\n"
-		"sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, long Ax)\n"
-		"sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, float Ax)\n"
-		"sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, double Ax)\n"
-		"sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax)\n"
-		"sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax)\n"
-		""},
+	 { (char *)"extract_csr_diagonal", _wrap_extract_csr_diagonal, METH_VARARGS, NULL},
+	 { (char *)"extract_csc_diagonal", _wrap_extract_csc_diagonal, METH_VARARGS, NULL},
+	 { (char *)"csrtocsc", _wrap_csrtocsc, METH_VARARGS, NULL},
+	 { (char *)"csctocsr", _wrap_csctocsr, METH_VARARGS, NULL},
+	 { (char *)"csrtocoo", _wrap_csrtocoo, METH_VARARGS, NULL},
+	 { (char *)"csctocoo", _wrap_csctocoo, METH_VARARGS, NULL},
+	 { (char *)"cootocsr", _wrap_cootocsr, METH_VARARGS, NULL},
+	 { (char *)"cootocsc", _wrap_cootocsc, 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 *)"csr_elmul_csr", _wrap_csr_elmul_csr, METH_VARARGS, NULL},
+	 { (char *)"csr_eldiv_csr", _wrap_csr_eldiv_csr, METH_VARARGS, NULL},
+	 { (char *)"csr_plus_csr", _wrap_csr_plus_csr, METH_VARARGS, NULL},
+	 { (char *)"csr_minus_csr", _wrap_csr_minus_csr, METH_VARARGS, NULL},
+	 { (char *)"csc_elmul_csc", _wrap_csc_elmul_csc, METH_VARARGS, NULL},
+	 { (char *)"csc_eldiv_csc", _wrap_csc_eldiv_csc, METH_VARARGS, NULL},
+	 { (char *)"csc_plus_csc", _wrap_csc_plus_csc, METH_VARARGS, NULL},
+	 { (char *)"csc_minus_csc", _wrap_csc_minus_csc, METH_VARARGS, NULL},
+	 { (char *)"spdiags", _wrap_spdiags, METH_VARARGS, NULL},
+	 { (char *)"csrtodense", _wrap_csrtodense, METH_VARARGS, NULL},
+	 { (char *)"densetocsr", _wrap_densetocsr, METH_VARARGS, NULL},
+	 { (char *)"sort_csr_indices", _wrap_sort_csr_indices, METH_VARARGS, NULL},
+	 { (char *)"sort_csc_indices", _wrap_sort_csc_indices, METH_VARARGS, NULL},
+	 { (char *)"sum_csr_duplicates", _wrap_sum_csr_duplicates, METH_VARARGS, NULL},
+	 { (char *)"sum_csc_duplicates", _wrap_sum_csc_duplicates, METH_VARARGS, NULL},
+	 { (char *)"get_csr_submatrix", _wrap_get_csr_submatrix, METH_VARARGS, NULL},
 	 { NULL, NULL, 0, NULL }
 };
 

Modified: trunk/scipy/sparse/tests/test_sparse.py
===================================================================
--- trunk/scipy/sparse/tests/test_sparse.py	2007-09-04 22:08:22 UTC (rev 3301)
+++ trunk/scipy/sparse/tests/test_sparse.py	2007-09-05 15:59:21 UTC (rev 3302)
@@ -641,6 +641,19 @@
             for ic in range( asp.shape[1] ):
                 assert_equal( asp[ir, ic], bsp[ir, ic] )
 
+    def check_get_submatrix(self):
+        a = sp.csr_matrix( array([[1,2,3],[1,2,3],[0,2,0]]) )
+        i0 = slice( 0, 2 )
+        i1 = slice( 1, 3 )
+        b = a.get_submatrix( i0, i1 )
+
+        aa = a.toarray()
+        ab = b.toarray()
+
+        assert b.dtype == a.dtype
+        assert b.shape == (2,2)
+        assert_equal( ab, aa[i0,i1] )
+
 class test_csc(_test_cs, _test_vert_slicing, _test_arith, NumpyTestCase):
     spmatrix = csc_matrix
 



More information about the Scipy-svn mailing list