[Scipy-svn] r3165 - trunk/Lib/sparse/sparsetools

scipy-svn@scip... scipy-svn@scip...
Sun Jul 15 02:09:19 CDT 2007


Author: wnbell
Date: 2007-07-15 02:09:14 -0500 (Sun, 15 Jul 2007)
New Revision: 3165

Modified:
   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
Log:
created C++ class to wrap NumPy complex types
providing overloaded operators  + - * / = etc.
allows cleaner (NumPy oblivious) implementation of sparsetools.h



Modified: trunk/Lib/sparse/sparsetools/complex_ops.h
===================================================================
--- trunk/Lib/sparse/sparsetools/complex_ops.h	2007-07-15 02:22:48 UTC (rev 3164)
+++ trunk/Lib/sparse/sparsetools/complex_ops.h	2007-07-15 07:09:14 UTC (rev 3165)
@@ -5,235 +5,85 @@
  *  Functions to handle arithmetic operations on NumPy complex values
  */
 
+#include <numpy/arrayobject.h>
 
 
+template <class c_type, class npy_type>
+class complex_wrapper : public npy_type {
+    public:
+        complex_wrapper( const c_type r = c_type(0), const c_type i = c_type(0) ){
+            npy_type::real = r;
+            npy_type::imag = i;
+        }
+        complex_wrapper operator-() const {
+          return complex_wrapper(-npy_type::real,-npy_type::imag);
+        }
+        complex_wrapper operator+(const complex_wrapper& B) const {
+          return complex_wrapper(npy_type::real + B.real, npy_type::imag + B.imag);
+        }
+        complex_wrapper operator-(const complex_wrapper& B) const {
+          return complex_wrapper(npy_type::real - B.real, npy_type::imag - B.imag);
+        }
+        complex_wrapper operator*(const complex_wrapper& B) const {
+          return complex_wrapper(npy_type::real * B.real - npy_type::imag * B.imag, 
+                                 npy_type::real * B.imag + npy_type::imag * B.real);
+        }
+        complex_wrapper operator/(const complex_wrapper& B) const {
+          complex_wrapper result;
+          c_type denom = 1.0 / (B.real * B.real + B.imag * B.imag);
+          result.real = (npy_type::real * npy_type::real + npy_type::imag * B.imag) * denom;
+          result.imag = (npy_type::real * npy_type::imag - npy_type::imag * B.real) * denom;
+          return result;
+        }
+        complex_wrapper& operator+=(const complex_wrapper & B){
+          npy_type::real += B.real;
+          npy_type::imag += B.imag;
+          return (*this);
+        }
+        complex_wrapper& operator-=(const complex_wrapper & B){
+          npy_type::real -= B.real;
+          npy_type::imag -= B.imag;
+          return (*this);
+        }
+        complex_wrapper& operator*=(const complex_wrapper & B){
+          c_type temp    = npy_type::real * B.real - npy_type::imag * B.imag;
+          npy_type::imag = npy_type::real * B.imag + npy_type::imag * B.real;
+          npy_type::real = temp;
+          return (*this);
+        }
+        complex_wrapper& operator/=(const complex_wrapper & B){
+          c_type denom   = 1.0 / (B.real * B.real + B.imag * B.imag);
+          c_type temp    = (npy_type::real * B.real + npy_type::imag * B.imag) * denom; 
+          npy_type::imag = (npy_type::real * B.imag - npy_type::imag * B.real) * denom;
+          npy_type::real = temp;
+          return (*this);
+        }
+        bool operator==(const complex_wrapper& B) const{
+          return npy_type::real == B.real && npy_type::imag == B.imag;
+        }
+        bool operator!=(const complex_wrapper& B) const{
+          return npy_type::real != B.real || npy_type::imag != B.imag;
+        }
+        bool operator==(const c_type& B) const{
+          return npy_type::real == B && npy_type::imag == c_type(0);
+        }
+        bool operator!=(const c_type& B) const{
+          return npy_type::real != B || npy_type::imag != c_type(0);
+        }
+        complex_wrapper& operator=(const complex_wrapper& B){
+          npy_type::real = B.real;
+          npy_type::imag = B.imag;
+          return (*this);
+        }
+        complex_wrapper& operator=(const c_type& B){
+          npy_type::real = B;
+          npy_type::imag = c_type(0);
+          return (*this);
+        }
+};
 
-/*
- * 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;
-}
+typedef complex_wrapper<float, npy_cfloat>  npy_cfloat_wrapper;
+typedef complex_wrapper<double,npy_cdouble> npy_cdouble_wrapper;
 
-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;
-}
 
-
-
-/*
- * Subtraction
- */
-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;
-}
-
-
-/*
- * Division
- */
-inline npy_cfloat operator/(const npy_cfloat& A, const npy_cfloat& B){
-  npy_cfloat result;
-  npy_float denom = 1.0 / (B.real * B.real + B.imag * B.imag);
-  result.real = (A.real * B.real + A.imag * B.imag) * denom;
-  result.imag = (A.real * B.imag - A.imag * B.real) * denom;
-  return result;
-}
-inline npy_cdouble operator/(const npy_cdouble& A, const npy_cdouble& B){
-  npy_cdouble result;
-  npy_double denom = 1.0 / (B.real * B.real + B.imag * B.imag);
-  result.real = (A.real * B.real + A.imag * B.imag) * denom;
-  result.imag = (A.real * B.imag - A.imag * B.real) * denom;
-  return result;
-}
-inline npy_clongdouble operator/(const npy_clongdouble& A, const npy_clongdouble& B){
-  npy_clongdouble result;
-  npy_longdouble denom = 1.0 / (B.real * B.real + B.imag * B.imag);
-  result.real = (A.real * B.real + A.imag * B.imag) * denom;
-  result.imag = (A.real * B.imag - A.imag * B.real) * denom;
-  return result;
-}
-
-inline npy_cfloat& operator/=(npy_cfloat& A, const npy_cfloat& B){
-  A = A*B;
-  return A;
-}
-inline npy_cdouble& operator/=(npy_cdouble& A, const npy_cdouble& B){
-  A = A*B;
-  return A;
-}
-inline npy_clongdouble& operator/=(npy_clongdouble& A, const npy_clongdouble& B){
-  A = A*B;
-  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

Modified: trunk/Lib/sparse/sparsetools/numpy.i
===================================================================
--- trunk/Lib/sparse/sparsetools/numpy.i	2007-07-15 02:22:48 UTC (rev 3164)
+++ trunk/Lib/sparse/sparsetools/numpy.i	2007-07-15 07:09:14 UTC (rev 3165)
@@ -5,7 +5,9 @@
 #endif
 #include "stdio.h"
 #include <numpy/arrayobject.h>
+#include "complex_ops.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
@@ -343,8 +345,8 @@
 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_cfloat_wrapper,         PyArray_CFLOAT )
+TYPEMAP_IN1(npy_cdouble_wrapper,        PyArray_CDOUBLE)
 TYPEMAP_IN1(npy_clongdouble,    PyArray_CLONGDOUBLE)
 TYPEMAP_IN1(const char,          PyArray_CHAR  )
 TYPEMAP_IN1(const unsigned char, PyArray_UBYTE )
@@ -355,8 +357,8 @@
 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_cfloat_wrapper,         PyArray_CFLOAT )
+TYPEMAP_IN1(const npy_cdouble_wrapper,        PyArray_CDOUBLE)
 TYPEMAP_IN1(const npy_clongdouble,    PyArray_CLONGDOUBLE)
 TYPEMAP_IN1(PyObject,      PyArray_OBJECT)
 
@@ -389,8 +391,8 @@
 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_cfloat_wrapper,         PyArray_CFLOAT )
+TYPEMAP_IN2(npy_cdouble_wrapper,        PyArray_CDOUBLE)
 TYPEMAP_IN2(npy_clongdouble,    PyArray_CLONGDOUBLE)
 TYPEMAP_IN2(const char,          PyArray_CHAR  )
 TYPEMAP_IN2(const unsigned char, PyArray_UBYTE )
@@ -401,8 +403,8 @@
 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_cfloat_wrapper,         PyArray_CFLOAT )
+TYPEMAP_IN2(const npy_cdouble_wrapper,        PyArray_CDOUBLE)
 TYPEMAP_IN2(const npy_clongdouble,    PyArray_CLONGDOUBLE)
 TYPEMAP_IN2(PyObject,      PyArray_OBJECT)
 
@@ -452,8 +454,8 @@
 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_cfloat_wrapper,         PyArray_CFLOAT )
+TYPEMAP_INPLACE1(npy_cdouble_wrapper,        PyArray_CDOUBLE)
 TYPEMAP_INPLACE1(npy_clongdouble,    PyArray_CLONGDOUBLE)
 TYPEMAP_INPLACE1(const char,          PyArray_CHAR  )
 TYPEMAP_INPLACE1(const unsigned char, PyArray_UBYTE )
@@ -464,8 +466,8 @@
 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_cfloat_wrapper,         PyArray_CFLOAT )
+TYPEMAP_INPLACE1(const npy_cdouble_wrapper,        PyArray_CDOUBLE)
 TYPEMAP_INPLACE1(const npy_clongdouble,    PyArray_CLONGDOUBLE)
 TYPEMAP_INPLACE1(PyObject,      PyArray_OBJECT)
 
@@ -494,8 +496,8 @@
 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_cfloat_wrapper,         PyArray_CFLOAT )
+TYPEMAP_INPLACE2(npy_cdouble_wrapper,        PyArray_CDOUBLE)
 TYPEMAP_INPLACE2(npy_clongdouble,    PyArray_CLONGDOUBLE)
 TYPEMAP_INPLACE2(const char,          PyArray_CHAR  )
 TYPEMAP_INPLACE2(const unsigned char, PyArray_UBYTE )
@@ -506,8 +508,8 @@
 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_cfloat_wrapper,         PyArray_CFLOAT )
+TYPEMAP_INPLACE2(const npy_cdouble_wrapper,        PyArray_CDOUBLE)
 TYPEMAP_INPLACE2(const npy_clongdouble,    PyArray_CLONGDOUBLE)
 TYPEMAP_INPLACE2(PyObject,      PyArray_OBJECT)
 
@@ -565,8 +567,8 @@
 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_cfloat_wrapper,         PyArray_CFLOAT )
+TYPEMAP_ARGOUT1(npy_cdouble_wrapper,        PyArray_CDOUBLE)
 TYPEMAP_ARGOUT1(npy_clongdouble,    PyArray_CLONGDOUBLE)
 TYPEMAP_ARGOUT1(PyObject,      PyArray_OBJECT)
 
@@ -593,8 +595,8 @@
 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_cfloat_wrapper,         PyArray_CFLOAT )
+TYPEMAP_ARGOUT2(npy_cdouble_wrapper,        PyArray_CDOUBLE)
 TYPEMAP_ARGOUT2(npy_clongdouble,    PyArray_CLONGDOUBLE)
 TYPEMAP_ARGOUT2(PyObject,      PyArray_OBJECT)
 
@@ -642,6 +644,6 @@
 NPY_TYPECHECK(        long,     LONG )
 NPY_TYPECHECK(       float,    FLOAT )
 NPY_TYPECHECK(      double,   DOUBLE )
-NPY_TYPECHECK(  npy_cfloat,   CFLOAT )
-NPY_TYPECHECK(  npy_cdouble, CDOUBLE )
+NPY_TYPECHECK(  npy_cfloat_wrapper,   CFLOAT )
+NPY_TYPECHECK(  npy_cdouble_wrapper, CDOUBLE )
 

Modified: trunk/Lib/sparse/sparsetools/sparsetools.h
===================================================================
--- trunk/Lib/sparse/sparsetools/sparsetools.h	2007-07-15 02:22:48 UTC (rev 3164)
+++ trunk/Lib/sparse/sparsetools/sparsetools.h	2007-07-15 07:09:14 UTC (rev 3165)
@@ -25,26 +25,7 @@
 
 
 
-
 /*
- * Return zero of the appropriate type
- *
- *  this is a workaround for NumPy complex types 
- *  where T x = 0; doesn't make sense.
-*
- */
-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:
@@ -76,13 +57,13 @@
  */
 template <class I, class T>
 void csrtocsc(const I n_row,
-	      const I n_col, 
-	      const I Ap[], 
-	      const I Aj[], 
-	      const T Ax[],
-	      std::vector<I>* Bp,
-	      std::vector<I>* Bi,
-	      std::vector<T>* Bx)
+	          const I n_col, 
+	          const I Ap[], 
+	          const I Aj[], 
+	          const T Ax[],
+	          std::vector<I>* Bp,
+	          std::vector<I>* Bi,
+	          std::vector<T>* Bx)
 {  
   I NNZ = Ap[n_row];
   
@@ -230,10 +211,8 @@
 {
   Cp->resize(n_row+1,0);
   
-  const T zero = ZERO<T>();
-
   std::vector<I> index(n_col,-1);
-  std::vector<T> sums(n_col,zero);
+  std::vector<T> sums(n_col,0);
 
   for(I i = 0; i < n_row; i++){
     I istart = -2;
@@ -255,7 +234,7 @@
     }         
 
     for(I jj = 0; jj < length; jj++){
-      if(sums[istart] != zero){
+      if(sums[istart] != 0){
 	    Cj->push_back(istart);
 	    Cx->push_back(sums[istart]);
       }
@@ -264,7 +243,7 @@
       istart = index[istart];
       
       index[temp] = -1; //clear arrays
-      sums[temp]  = zero;                              
+      sums[temp]  =  0;                              
     }
     
     (*Cp)[i+1] = Cx->size();
@@ -305,25 +284,23 @@
  */
 template <class I, class T, class bin_op>
 void csr_binop_csr(const I n_row,
-                 const I n_col, 
-                 const I Ap[], 
-                 const I Aj[], 
-                 const T Ax[],
-                 const I Bp[],
-                 const I Bj[],
-                 const T Bx[],
-                 std::vector<I>* Cp,
-                 std::vector<I>* Cj,
-                 std::vector<T>* Cx,
-                 const bin_op& op)
+                   const I n_col, 
+                   const I Ap[], 
+                   const I Aj[], 
+                   const T Ax[],
+                   const I Bp[],
+                   const I Bj[],
+                   const T Bx[],
+                   std::vector<I>* Cp,
+                   std::vector<I>* Cj,
+                   std::vector<T>* Cx,
+                   const bin_op& op)
 {
   Cp->resize(n_row+1,0);
   
-  const T zero = ZERO<T>();
-
   std::vector<I>   index(n_col,-1);
-  std::vector<T> A_row(n_col,zero);
-  std::vector<T> B_row(n_col,zero);
+  std::vector<T> A_row(n_col,0);
+  std::vector<T> B_row(n_col,0);
 
   for(I i = 0; i < n_row; i++){
     I istart = -2;
@@ -359,7 +336,7 @@
     for(I jj = 0; jj < length; jj++){
       T result = op(A_row[istart],B_row[istart]);
       
-      if(result != zero){
+      if(result != 0){
 	    Cj->push_back(istart);
 	    Cx->push_back(result);
       }
@@ -368,8 +345,8 @@
       istart = index[istart];
       
       index[temp] = -1;
-      A_row[temp] = zero;                              
-      B_row[temp] = zero;
+      A_row[temp] =  0;                              
+      B_row[temp] =  0;
     }
     
     (*Cp)[i+1] = Cx->size();
@@ -438,10 +415,8 @@
                               I Aj[], 
                               T Ax[])
 {
-  const T zero = ZERO<T>();
-
   std::vector<I>  next(n_col,-1);
-  std::vector<T>  sums(n_col,zero);
+  std::vector<T>  sums(n_col, 0);
 
   I NNZ = 0;
 
@@ -473,7 +448,7 @@
         Ax[NNZ] = sums[curr];
 
         next[curr] = -1;
-        sums[curr] = zero;
+        sums[curr] =  0;
 
         NNZ++;
     }
@@ -585,25 +560,24 @@
  */
 template <class I, class T>
 void csrmux(const I n_row,
-	    const I n_col, 
-	    const I Ap [], 
-	    const I Aj[], 
-	    const T Ax[],
-	    const T Xx[],
-	    std::vector<T>*  Yx)
+	        const I n_col, 
+	        const I Ap [], 
+	        const I Aj[], 
+	        const T Ax[],
+	        const T Xx[],
+	        std::vector<T>*  Yx)
 {
-  const T zero = ZERO<T>();
+  Yx->resize(n_row);
 
-  Yx->resize(n_row,zero);
-
   for(I i = 0; i < n_row; i++){
     I row_start = Ap[i];
     I row_end   = Ap[i+1];
     
-    T& Yx_i = (*Yx)[i];
+    T sum = 0;
     for(I jj = row_start; jj < row_end; jj++){
-      Yx_i += Ax[jj] * Xx[Aj[jj]];
+      sum += Ax[jj] * Xx[Aj[jj]];
     }
+    (*Yx)[i] = sum;
   }
 }
 
@@ -633,16 +607,14 @@
  */
 template <class I, class T>
 void cscmux(const I n_row,
-	    const I n_col, 
-	    const I Ap[], 
-	    const I Ai[], 
-	    const T Ax[],
-	    const T Xx[],
-	    std::vector<T>*  Yx)
+	        const I n_col, 
+	        const I Ap[], 
+	        const I Ai[], 
+	        const T Ax[],
+	        const T Xx[],
+	        std::vector<T>*  Yx)
 {
-  const T zero = ZERO<T>();
-
-  Yx->resize(n_row,zero);
+  Yx->resize(n_row,0);
   
   for(I j = 0; j < n_col; j++){
     I col_start = Ap[j];
@@ -777,13 +749,12 @@
                 std::vector<I>* Aj,
                 std::vector<T>* Ax)
 {
-  const T  zero  = ZERO<T>();
   const T* x_ptr = Mx;
 
   Ap->push_back(0);
   for(I i = 0; i < n_row; i++){
     for(I j = 0; j < n_col; j++){
-      if(*x_ptr != zero){
+      if(*x_ptr != 0){
 	    Aj->push_back(j);
 	    Ax->push_back(*x_ptr);
       }
@@ -916,9 +887,9 @@
 
 template <class I, class T>
 void csc_plus_csc(const I n_row, const I n_col, 
-                 const I Ap [], const I Ai [], const T Ax [],
-                 const I Bp [], const I Bi [], const T Bx [],
-                 std::vector<I>* Cp, std::vector<I>* Ci, std::vector<T>* Cx)
+                  const I Ap [], const I Ai [], const T Ax [],
+                  const I Bp [], const I Bi [], const T Bx [],
+                  std::vector<I>* Cp, std::vector<I>* Ci, std::vector<T>* Cx)
 {
     csr_plus_csr(n_col,n_row,Ap,Ai,Ax,Bp,Bi,Bx,Cp,Ci,Cx);
 }

Modified: trunk/Lib/sparse/sparsetools/sparsetools.i
===================================================================
--- trunk/Lib/sparse/sparsetools/sparsetools.i	2007-07-15 02:22:48 UTC (rev 3164)
+++ trunk/Lib/sparse/sparsetools/sparsetools.i	2007-07-15 07:09:14 UTC (rev 3165)
@@ -61,15 +61,15 @@
 T_IN_ARRAY1( long        )
 T_IN_ARRAY1( float       )
 T_IN_ARRAY1( double      )
-T_IN_ARRAY1( npy_cfloat  )
-T_IN_ARRAY1( npy_cdouble )
+T_IN_ARRAY1( npy_cfloat_wrapper  )
+T_IN_ARRAY1( npy_cdouble_wrapper )
 
 T_IN_ARRAY2( int         )
 T_IN_ARRAY2( long        )
 T_IN_ARRAY2( float       )
 T_IN_ARRAY2( double      )
-T_IN_ARRAY2( npy_cfloat  )
-T_IN_ARRAY2( npy_cdouble )
+T_IN_ARRAY2( npy_cfloat_wrapper  )
+T_IN_ARRAY2( npy_cdouble_wrapper )
 
 
 
@@ -111,8 +111,8 @@
 T_ARRAY_ARGOUT( long,        LONG    )
 T_ARRAY_ARGOUT( float,       FLOAT   )
 T_ARRAY_ARGOUT( double,      DOUBLE  )
-T_ARRAY_ARGOUT( npy_cfloat,  CFLOAT  )
-T_ARRAY_ARGOUT( npy_cdouble, CDOUBLE )
+T_ARRAY_ARGOUT( npy_cfloat_wrapper,  CFLOAT  )
+T_ARRAY_ARGOUT( npy_cdouble_wrapper, CDOUBLE )
 
 
 
@@ -129,8 +129,8 @@
 T_INPLACE_ARRAY2( long        )
 T_INPLACE_ARRAY2( float       )
 T_INPLACE_ARRAY2( double      )
-T_INPLACE_ARRAY2( npy_cfloat  )
-T_INPLACE_ARRAY2( npy_cdouble )
+T_INPLACE_ARRAY2( npy_cfloat_wrapper  )
+T_INPLACE_ARRAY2( npy_cdouble_wrapper )
 
 
 
@@ -154,8 +154,8 @@
 T_INPLACE_ARRAY1( long        )
 T_INPLACE_ARRAY1( float       )
 T_INPLACE_ARRAY1( double      )
-T_INPLACE_ARRAY1( npy_cfloat  )
-T_INPLACE_ARRAY1( npy_cdouble )
+T_INPLACE_ARRAY1( npy_cfloat_wrapper  )
+T_INPLACE_ARRAY1( npy_cdouble_wrapper )
 
 
 
@@ -172,8 +172,8 @@
 %template(f_name)   f_name<int,long>;
 %template(f_name)   f_name<int,float>;
 %template(f_name)   f_name<int,double>;
-%template(f_name)   f_name<int,npy_cfloat>;
-%template(f_name)   f_name<int,npy_cdouble>;
+%template(f_name)   f_name<int,npy_cfloat_wrapper>;
+%template(f_name)   f_name<int,npy_cdouble_wrapper>;
 /* 64-bit indices would go here */
 %enddef
 

Modified: trunk/Lib/sparse/sparsetools/sparsetools.py
===================================================================
--- trunk/Lib/sparse/sparsetools/sparsetools.py	2007-07-15 02:22:48 UTC (rev 3164)
+++ trunk/Lib/sparse/sparsetools/sparsetools.py	2007-07-15 07:09:14 UTC (rev 3165)
@@ -60,12 +60,12 @@
         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, npy_cfloat Ax, 
+    csrtocsc(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper 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<(npy_cfloat_wrapper)> Bx)
+    csrtocsc(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
         std::vector<(int)> Bp, std::vector<(int)> Bi, 
-        std::vector<(npy_cdouble)> Bx)
+        std::vector<(npy_cdouble_wrapper)> Bx)
     """
   return _sparsetools.csrtocsc(*args)
 
@@ -79,12 +79,12 @@
         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, npy_cfloat Ax, 
+    csctocsr(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper 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<(npy_cfloat_wrapper)> Bx)
+    csctocsr(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
         std::vector<(int)> Bp, std::vector<(int)> Bj, 
-        std::vector<(npy_cdouble)> Bx)
+        std::vector<(npy_cdouble_wrapper)> Bx)
     """
   return _sparsetools.csctocsr(*args)
 
@@ -98,12 +98,12 @@
         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, npy_cfloat Ax, 
+    csrtocoo(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper 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<(npy_cfloat_wrapper)> Bx)
+    csrtocoo(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
         std::vector<(int)> Bi, std::vector<(int)> Bj, 
-        std::vector<(npy_cdouble)> Bx)
+        std::vector<(npy_cdouble_wrapper)> Bx)
     """
   return _sparsetools.csrtocoo(*args)
 
@@ -117,12 +117,12 @@
         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, npy_cfloat Ax, 
+    csctocoo(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper 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<(npy_cfloat_wrapper)> Bx)
+    csctocoo(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
         std::vector<(int)> Bi, std::vector<(int)> Bj, 
-        std::vector<(npy_cdouble)> Bx)
+        std::vector<(npy_cdouble_wrapper)> Bx)
     """
   return _sparsetools.csctocoo(*args)
 
@@ -140,12 +140,12 @@
     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, npy_cfloat Ax, 
+    cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cfloat_wrapper 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<(npy_cfloat_wrapper)> Bx)
+    cootocsr(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cdouble_wrapper Ax, 
         std::vector<(int)> Bp, std::vector<(int)> Bj, 
-        std::vector<(npy_cdouble)> Bx)
+        std::vector<(npy_cdouble_wrapper)> Bx)
     """
   return _sparsetools.cootocsr(*args)
 
@@ -163,12 +163,12 @@
     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, npy_cfloat Ax, 
+    cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cfloat_wrapper 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<(npy_cfloat_wrapper)> Bx)
+    cootocsc(int n_row, int n_col, int NNZ, int Ai, int Aj, npy_cdouble_wrapper Ax, 
         std::vector<(int)> Bp, std::vector<(int)> Bi, 
-        std::vector<(npy_cdouble)> Bx)
+        std::vector<(npy_cdouble_wrapper)> Bx)
     """
   return _sparsetools.cootocsc(*args)
 
@@ -186,12 +186,14 @@
     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, 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_cfloat_wrapper Ax, 
+        int Bp, int Bj, npy_cfloat_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Cj, 
+        std::vector<(npy_cfloat_wrapper)> Cx)
+    csrmucsr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
+        int Bp, int Bj, npy_cdouble_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Cj, 
+        std::vector<(npy_cdouble_wrapper)> Cx)
     """
   return _sparsetools.csrmucsr(*args)
 
@@ -209,12 +211,14 @@
     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, 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_cfloat_wrapper Ax, 
+        int Bp, int Bi, npy_cfloat_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Ci, 
+        std::vector<(npy_cfloat_wrapper)> Cx)
+    cscmucsc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
+        int Bp, int Bi, npy_cdouble_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Ci, 
+        std::vector<(npy_cdouble_wrapper)> Cx)
     """
   return _sparsetools.cscmucsc(*args)
 
@@ -228,10 +232,10 @@
         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, 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_cfloat_wrapper Ax, 
+        npy_cfloat_wrapper Xx, std::vector<(npy_cfloat_wrapper)> Yx)
+    csrmux(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
+        npy_cdouble_wrapper Xx, std::vector<(npy_cdouble_wrapper)> Yx)
     """
   return _sparsetools.csrmux(*args)
 
@@ -245,10 +249,10 @@
         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, 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_cfloat_wrapper Ax, 
+        npy_cfloat_wrapper Xx, std::vector<(npy_cfloat_wrapper)> Yx)
+    cscmux(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
+        npy_cdouble_wrapper Xx, std::vector<(npy_cdouble_wrapper)> Yx)
     """
   return _sparsetools.cscmux(*args)
 
@@ -266,12 +270,14 @@
     csr_elmul_csr(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)
-    csr_elmul_csr(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)
-    csr_elmul_csr(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)
+    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
+        int Bp, int Bj, npy_cfloat_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Cj, 
+        std::vector<(npy_cfloat_wrapper)> Cx)
+    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
+        int Bp, int Bj, npy_cdouble_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Cj, 
+        std::vector<(npy_cdouble_wrapper)> Cx)
     """
   return _sparsetools.csr_elmul_csr(*args)
 
@@ -289,12 +295,14 @@
     csr_eldiv_csr(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)
-    csr_eldiv_csr(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)
-    csr_eldiv_csr(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)
+    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
+        int Bp, int Bj, npy_cfloat_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Cj, 
+        std::vector<(npy_cfloat_wrapper)> Cx)
+    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
+        int Bp, int Bj, npy_cdouble_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Cj, 
+        std::vector<(npy_cdouble_wrapper)> Cx)
     """
   return _sparsetools.csr_eldiv_csr(*args)
 
@@ -312,12 +320,14 @@
     csr_plus_csr(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)
-    csr_plus_csr(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)
-    csr_plus_csr(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)
+    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
+        int Bp, int Bj, npy_cfloat_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Cj, 
+        std::vector<(npy_cfloat_wrapper)> Cx)
+    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
+        int Bp, int Bj, npy_cdouble_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Cj, 
+        std::vector<(npy_cdouble_wrapper)> Cx)
     """
   return _sparsetools.csr_plus_csr(*args)
 
@@ -335,12 +345,14 @@
     csr_minus_csr(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)
-    csr_minus_csr(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)
-    csr_minus_csr(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)
+    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
+        int Bp, int Bj, npy_cfloat_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Cj, 
+        std::vector<(npy_cfloat_wrapper)> Cx)
+    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
+        int Bp, int Bj, npy_cdouble_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Cj, 
+        std::vector<(npy_cdouble_wrapper)> Cx)
     """
   return _sparsetools.csr_minus_csr(*args)
 
@@ -358,12 +370,14 @@
     csc_elmul_csc(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)
-    csc_elmul_csc(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)
-    csc_elmul_csc(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)
+    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, 
+        int Bp, int Bi, npy_cfloat_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Ci, 
+        std::vector<(npy_cfloat_wrapper)> Cx)
+    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
+        int Bp, int Bi, npy_cdouble_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Ci, 
+        std::vector<(npy_cdouble_wrapper)> Cx)
     """
   return _sparsetools.csc_elmul_csc(*args)
 
@@ -381,12 +395,14 @@
     csc_eldiv_csc(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)
-    csc_eldiv_csc(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)
-    csc_eldiv_csc(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)
+    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, 
+        int Bp, int Bi, npy_cfloat_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Ci, 
+        std::vector<(npy_cfloat_wrapper)> Cx)
+    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
+        int Bp, int Bi, npy_cdouble_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Ci, 
+        std::vector<(npy_cdouble_wrapper)> Cx)
     """
   return _sparsetools.csc_eldiv_csc(*args)
 
@@ -404,12 +420,14 @@
     csc_plus_csc(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)
-    csc_plus_csc(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)
-    csc_plus_csc(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)
+    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, 
+        int Bp, int Bi, npy_cfloat_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Ci, 
+        std::vector<(npy_cfloat_wrapper)> Cx)
+    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
+        int Bp, int Bi, npy_cdouble_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Ci, 
+        std::vector<(npy_cdouble_wrapper)> Cx)
     """
   return _sparsetools.csc_plus_csc(*args)
 
@@ -427,12 +445,14 @@
     csc_minus_csc(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)
-    csc_minus_csc(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)
-    csc_minus_csc(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)
+    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, 
+        int Bp, int Bi, npy_cfloat_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Ci, 
+        std::vector<(npy_cfloat_wrapper)> Cx)
+    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
+        int Bp, int Bi, npy_cdouble_wrapper Bx, 
+        std::vector<(int)> Cp, std::vector<(int)> Ci, 
+        std::vector<(npy_cdouble_wrapper)> Cx)
     """
   return _sparsetools.csc_minus_csc(*args)
 
@@ -450,12 +470,12 @@
     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, 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_cfloat_wrapper diags, 
+        std::vector<(int)> Ap, 
+        std::vector<(int)> Ai, std::vector<(npy_cfloat_wrapper)> Ax)
+    spdiags(int n_row, int n_col, int n_diag, int offsets, npy_cdouble_wrapper diags, 
+        std::vector<(int)> Ap, 
+        std::vector<(int)> Ai, std::vector<(npy_cdouble_wrapper)> Ax)
     """
   return _sparsetools.spdiags(*args)
 
@@ -465,10 +485,10 @@
     csrtodense(int n_row, int n_col, int Ap, int Aj, long Ax, long Mx)
     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, 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_cfloat_wrapper Ax, 
+        npy_cfloat_wrapper Mx)
+    csrtodense(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
+        npy_cdouble_wrapper Mx)
     """
   return _sparsetools.csrtodense(*args)
 
@@ -482,10 +502,10 @@
         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, 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_cfloat_wrapper Mx, std::vector<(int)> Ap, 
+        std::vector<(int)> Aj, std::vector<(npy_cfloat_wrapper)> Ax)
+    densetocsr(int n_row, int n_col, npy_cdouble_wrapper Mx, std::vector<(int)> Ap, 
+        std::vector<(int)> Aj, std::vector<(npy_cdouble_wrapper)> Ax)
     """
   return _sparsetools.densetocsr(*args)
 
@@ -495,8 +515,8 @@
     sort_csr_indices(int n_row, int n_col, int Ap, int Aj, long Ax)
     sort_csr_indices(int n_row, int n_col, int Ap, int Aj, float Ax)
     sort_csr_indices(int n_row, int n_col, int Ap, int Aj, double Ax)
-    sort_csr_indices(int n_row, int n_col, int Ap, int Aj, npy_cfloat Ax)
-    sort_csr_indices(int n_row, int n_col, int Ap, int Aj, npy_cdouble Ax)
+    sort_csr_indices(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax)
+    sort_csr_indices(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax)
     """
   return _sparsetools.sort_csr_indices(*args)
 
@@ -506,8 +526,8 @@
     sort_csc_indices(int n_row, int n_col, int Ap, int Ai, long Ax)
     sort_csc_indices(int n_row, int n_col, int Ap, int Ai, float Ax)
     sort_csc_indices(int n_row, int n_col, int Ap, int Ai, double Ax)
-    sort_csc_indices(int n_row, int n_col, int Ap, int Ai, npy_cfloat Ax)
-    sort_csc_indices(int n_row, int n_col, int Ap, int Ai, npy_cdouble Ax)
+    sort_csc_indices(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax)
+    sort_csc_indices(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax)
     """
   return _sparsetools.sort_csc_indices(*args)
 
@@ -517,8 +537,8 @@
     sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, long Ax)
     sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, float Ax)
     sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, double Ax)
-    sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, npy_cfloat Ax)
-    sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, npy_cdouble Ax)
+    sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax)
+    sum_csr_duplicates(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax)
     """
   return _sparsetools.sum_csr_duplicates(*args)
 
@@ -528,8 +548,8 @@
     sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, long Ax)
     sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, float Ax)
     sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, double Ax)
-    sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, npy_cfloat Ax)
-    sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, npy_cdouble Ax)
+    sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax)
+    sum_csc_duplicates(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax)
     """
   return _sparsetools.sum_csc_duplicates(*args)
 

Modified: trunk/Lib/sparse/sparsetools/sparsetools_wrap.cxx
===================================================================
--- trunk/Lib/sparse/sparsetools/sparsetools_wrap.cxx	2007-07-15 02:22:48 UTC (rev 3164)
+++ trunk/Lib/sparse/sparsetools/sparsetools_wrap.cxx	2007-07-15 07:09:14 UTC (rev 3165)
@@ -2473,8 +2473,8 @@
 #define SWIGTYPE_p_std__vectorTfloat_t swig_types[3]
 #define SWIGTYPE_p_std__vectorTint_t swig_types[4]
 #define SWIGTYPE_p_std__vectorTlong_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_cdouble_wrapper_t swig_types[6]
+#define SWIGTYPE_p_std__vectorTnpy_cfloat_wrapper_t swig_types[7]
 static swig_type_info *swig_types[9];
 static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
@@ -2578,7 +2578,9 @@
 #endif
 #include "stdio.h"
 #include <numpy/arrayobject.h>
+#include "complex_ops.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
@@ -3516,10 +3518,10 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cfloat *arg5 ;
+  npy_cfloat_wrapper *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 ;
+  std::vector<npy_cfloat_wrapper > *arg8 = (std::vector<npy_cfloat_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -3532,7 +3534,7 @@
   int is_new_object5 ;
   std::vector<int > *tmp6 ;
   std::vector<int > *tmp7 ;
-  std::vector<npy_cfloat > *tmp8 ;
+  std::vector<npy_cfloat_wrapper > *tmp8 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -3548,7 +3550,7 @@
     arg7 = tmp7; 
   }
   {
-    tmp8 = new std::vector<npy_cfloat>(); 
+    tmp8 = new std::vector<npy_cfloat_wrapper>(); 
     arg8 = tmp8; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocsc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
@@ -3584,9 +3586,9 @@
     };
     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;
+    arg5 = (npy_cfloat_wrapper*) array5->data;
   }
-  csrtocsc<int,npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,arg6,arg7,arg8);
+  csrtocsc<int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6,arg7,arg8);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg6)->size(); 
@@ -3605,7 +3607,7 @@
   {
     int length = (arg8)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
-    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat_wrapper)*length);	 
     delete arg8; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -3639,10 +3641,10 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cdouble *arg5 ;
+  npy_cdouble_wrapper *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 ;
+  std::vector<npy_cdouble_wrapper > *arg8 = (std::vector<npy_cdouble_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -3655,7 +3657,7 @@
   int is_new_object5 ;
   std::vector<int > *tmp6 ;
   std::vector<int > *tmp7 ;
-  std::vector<npy_cdouble > *tmp8 ;
+  std::vector<npy_cdouble_wrapper > *tmp8 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -3671,7 +3673,7 @@
     arg7 = tmp7; 
   }
   {
-    tmp8 = new std::vector<npy_cdouble>(); 
+    tmp8 = new std::vector<npy_cdouble_wrapper>(); 
     arg8 = tmp8; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocsc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
@@ -3707,9 +3709,9 @@
     };
     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;
+    arg5 = (npy_cdouble_wrapper*) array5->data;
   }
-  csrtocsc<int,npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,arg6,arg7,arg8);
+  csrtocsc<int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6,arg7,arg8);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg6)->size(); 
@@ -3728,7 +3730,7 @@
   {
     int length = (arg8)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
-    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble_wrapper)*length);	 
     delete arg8; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -3954,7 +3956,7 @@
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csrtocsc'.\n  Possible C/C++ prototypes are:\n    csrtocsc<(int,int)>(int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    csrtocsc<(int,long)>(int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    csrtocsc<(int,float)>(int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    csrtocsc<(int,double)>(int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    csrtocsc<(int,npy_cfloat)>(int const,int const,int const [],int const [],npy_cfloat const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat > *)\n    csrtocsc<(int,npy_cdouble)>(int const,int const,int const [],int const [],npy_cdouble const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble > *)\n");
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csrtocsc'.\n  Possible C/C++ prototypes are:\n    csrtocsc<(int,int)>(int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    csrtocsc<(int,long)>(int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    csrtocsc<(int,float)>(int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    csrtocsc<(int,double)>(int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    csrtocsc<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat_wrapper > *)\n    csrtocsc<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble_wrapper > *)\n");
   return NULL;
 }
 
@@ -4457,10 +4459,10 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cfloat *arg5 ;
+  npy_cfloat_wrapper *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 ;
+  std::vector<npy_cfloat_wrapper > *arg8 = (std::vector<npy_cfloat_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -4473,7 +4475,7 @@
   int is_new_object5 ;
   std::vector<int > *tmp6 ;
   std::vector<int > *tmp7 ;
-  std::vector<npy_cfloat > *tmp8 ;
+  std::vector<npy_cfloat_wrapper > *tmp8 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -4489,7 +4491,7 @@
     arg7 = tmp7; 
   }
   {
-    tmp8 = new std::vector<npy_cfloat>(); 
+    tmp8 = new std::vector<npy_cfloat_wrapper>(); 
     arg8 = tmp8; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocsr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
@@ -4525,9 +4527,9 @@
     };
     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;
+    arg5 = (npy_cfloat_wrapper*) array5->data;
   }
-  csctocsr<int,npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,arg6,arg7,arg8);
+  csctocsr<int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6,arg7,arg8);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg6)->size(); 
@@ -4546,7 +4548,7 @@
   {
     int length = (arg8)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
-    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat_wrapper)*length);	 
     delete arg8; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -4580,10 +4582,10 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cdouble *arg5 ;
+  npy_cdouble_wrapper *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 ;
+  std::vector<npy_cdouble_wrapper > *arg8 = (std::vector<npy_cdouble_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -4596,7 +4598,7 @@
   int is_new_object5 ;
   std::vector<int > *tmp6 ;
   std::vector<int > *tmp7 ;
-  std::vector<npy_cdouble > *tmp8 ;
+  std::vector<npy_cdouble_wrapper > *tmp8 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -4612,7 +4614,7 @@
     arg7 = tmp7; 
   }
   {
-    tmp8 = new std::vector<npy_cdouble>(); 
+    tmp8 = new std::vector<npy_cdouble_wrapper>(); 
     arg8 = tmp8; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocsr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
@@ -4648,9 +4650,9 @@
     };
     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;
+    arg5 = (npy_cdouble_wrapper*) array5->data;
   }
-  csctocsr<int,npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,arg6,arg7,arg8);
+  csctocsr<int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6,arg7,arg8);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg6)->size(); 
@@ -4669,7 +4671,7 @@
   {
     int length = (arg8)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
-    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble_wrapper)*length);	 
     delete arg8; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -4895,7 +4897,7 @@
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csctocsr'.\n  Possible C/C++ prototypes are:\n    csctocsr<(int,int)>(int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    csctocsr<(int,long)>(int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    csctocsr<(int,float)>(int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    csctocsr<(int,double)>(int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    csctocsr<(int,npy_cfloat)>(int const,int const,int const [],int const [],npy_cfloat const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat > *)\n    csctocsr<(int,npy_cdouble)>(int const,int const,int const [],int const [],npy_cdouble const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble > *)\n");
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csctocsr'.\n  Possible C/C++ prototypes are:\n    csctocsr<(int,int)>(int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    csctocsr<(int,long)>(int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    csctocsr<(int,float)>(int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    csctocsr<(int,double)>(int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    csctocsr<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat_wrapper > *)\n    csctocsr<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble_wrapper > *)\n");
   return NULL;
 }
 
@@ -5398,10 +5400,10 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cfloat *arg5 ;
+  npy_cfloat_wrapper *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 ;
+  std::vector<npy_cfloat_wrapper > *arg8 = (std::vector<npy_cfloat_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -5414,7 +5416,7 @@
   int is_new_object5 ;
   std::vector<int > *tmp6 ;
   std::vector<int > *tmp7 ;
-  std::vector<npy_cfloat > *tmp8 ;
+  std::vector<npy_cfloat_wrapper > *tmp8 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -5430,7 +5432,7 @@
     arg7 = tmp7; 
   }
   {
-    tmp8 = new std::vector<npy_cfloat>(); 
+    tmp8 = new std::vector<npy_cfloat_wrapper>(); 
     arg8 = tmp8; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
@@ -5466,9 +5468,9 @@
     };
     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;
+    arg5 = (npy_cfloat_wrapper*) array5->data;
   }
-  csrtocoo<int,npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,arg6,arg7,arg8);
+  csrtocoo<int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6,arg7,arg8);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg6)->size(); 
@@ -5487,7 +5489,7 @@
   {
     int length = (arg8)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
-    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat_wrapper)*length);	 
     delete arg8; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -5521,10 +5523,10 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cdouble *arg5 ;
+  npy_cdouble_wrapper *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 ;
+  std::vector<npy_cdouble_wrapper > *arg8 = (std::vector<npy_cdouble_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -5537,7 +5539,7 @@
   int is_new_object5 ;
   std::vector<int > *tmp6 ;
   std::vector<int > *tmp7 ;
-  std::vector<npy_cdouble > *tmp8 ;
+  std::vector<npy_cdouble_wrapper > *tmp8 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -5553,7 +5555,7 @@
     arg7 = tmp7; 
   }
   {
-    tmp8 = new std::vector<npy_cdouble>(); 
+    tmp8 = new std::vector<npy_cdouble_wrapper>(); 
     arg8 = tmp8; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:csrtocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
@@ -5589,9 +5591,9 @@
     };
     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;
+    arg5 = (npy_cdouble_wrapper*) array5->data;
   }
-  csrtocoo<int,npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,arg6,arg7,arg8);
+  csrtocoo<int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6,arg7,arg8);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg6)->size(); 
@@ -5610,7 +5612,7 @@
   {
     int length = (arg8)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
-    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble_wrapper)*length);	 
     delete arg8; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -5836,7 +5838,7 @@
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csrtocoo'.\n  Possible C/C++ prototypes are:\n    csrtocoo<(int,int)>(int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    csrtocoo<(int,long)>(int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    csrtocoo<(int,float)>(int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    csrtocoo<(int,double)>(int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    csrtocoo<(int,npy_cfloat)>(int const,int const,int const [],int const [],npy_cfloat const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat > *)\n    csrtocoo<(int,npy_cdouble)>(int const,int const,int const [],int const [],npy_cdouble const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble > *)\n");
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csrtocoo'.\n  Possible C/C++ prototypes are:\n    csrtocoo<(int,int)>(int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    csrtocoo<(int,long)>(int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    csrtocoo<(int,float)>(int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    csrtocoo<(int,double)>(int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    csrtocoo<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat_wrapper > *)\n    csrtocoo<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble_wrapper > *)\n");
   return NULL;
 }
 
@@ -6339,10 +6341,10 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cfloat *arg5 ;
+  npy_cfloat_wrapper *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 ;
+  std::vector<npy_cfloat_wrapper > *arg8 = (std::vector<npy_cfloat_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -6355,7 +6357,7 @@
   int is_new_object5 ;
   std::vector<int > *tmp6 ;
   std::vector<int > *tmp7 ;
-  std::vector<npy_cfloat > *tmp8 ;
+  std::vector<npy_cfloat_wrapper > *tmp8 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -6371,7 +6373,7 @@
     arg7 = tmp7; 
   }
   {
-    tmp8 = new std::vector<npy_cfloat>(); 
+    tmp8 = new std::vector<npy_cfloat_wrapper>(); 
     arg8 = tmp8; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
@@ -6407,9 +6409,9 @@
     };
     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;
+    arg5 = (npy_cfloat_wrapper*) array5->data;
   }
-  csctocoo<int,npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,arg6,arg7,arg8);
+  csctocoo<int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6,arg7,arg8);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg6)->size(); 
@@ -6428,7 +6430,7 @@
   {
     int length = (arg8)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
-    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cfloat_wrapper)*length);	 
     delete arg8; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -6462,10 +6464,10 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cdouble *arg5 ;
+  npy_cdouble_wrapper *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 ;
+  std::vector<npy_cdouble_wrapper > *arg8 = (std::vector<npy_cdouble_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -6478,7 +6480,7 @@
   int is_new_object5 ;
   std::vector<int > *tmp6 ;
   std::vector<int > *tmp7 ;
-  std::vector<npy_cdouble > *tmp8 ;
+  std::vector<npy_cdouble_wrapper > *tmp8 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -6494,7 +6496,7 @@
     arg7 = tmp7; 
   }
   {
-    tmp8 = new std::vector<npy_cdouble>(); 
+    tmp8 = new std::vector<npy_cdouble_wrapper>(); 
     arg8 = tmp8; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOO:csctocoo",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
@@ -6530,9 +6532,9 @@
     };
     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;
+    arg5 = (npy_cdouble_wrapper*) array5->data;
   }
-  csctocoo<int,npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,arg6,arg7,arg8);
+  csctocoo<int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6,arg7,arg8);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg6)->size(); 
@@ -6551,7 +6553,7 @@
   {
     int length = (arg8)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
-    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg8))[0]),sizeof(npy_cdouble_wrapper)*length);	 
     delete arg8; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -6777,7 +6779,7 @@
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csctocoo'.\n  Possible C/C++ prototypes are:\n    csctocoo<(int,int)>(int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    csctocoo<(int,long)>(int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    csctocoo<(int,float)>(int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    csctocoo<(int,double)>(int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    csctocoo<(int,npy_cfloat)>(int const,int const,int const [],int const [],npy_cfloat const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat > *)\n    csctocoo<(int,npy_cdouble)>(int const,int const,int const [],int const [],npy_cdouble const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble > *)\n");
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csctocoo'.\n  Possible C/C++ prototypes are:\n    csctocoo<(int,int)>(int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    csctocoo<(int,long)>(int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    csctocoo<(int,float)>(int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    csctocoo<(int,double)>(int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    csctocoo<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat_wrapper > *)\n    csctocoo<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble_wrapper > *)\n");
   return NULL;
 }
 
@@ -7317,10 +7319,10 @@
   int arg3 ;
   int *arg4 ;
   int *arg5 ;
-  npy_cfloat *arg6 ;
+  npy_cfloat_wrapper *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 ;
+  std::vector<npy_cfloat_wrapper > *arg9 = (std::vector<npy_cfloat_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -7335,7 +7337,7 @@
   int is_new_object6 ;
   std::vector<int > *tmp7 ;
   std::vector<int > *tmp8 ;
-  std::vector<npy_cfloat > *tmp9 ;
+  std::vector<npy_cfloat_wrapper > *tmp9 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -7352,7 +7354,7 @@
     arg8 = tmp8; 
   }
   {
-    tmp9 = new std::vector<npy_cfloat>(); 
+    tmp9 = new std::vector<npy_cfloat_wrapper>(); 
     arg9 = tmp9; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
@@ -7393,9 +7395,9 @@
     };
     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;
+    arg6 = (npy_cfloat_wrapper*) array6->data;
   }
-  cootocsr<int,npy_cfloat >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat const (*))arg6,arg7,arg8,arg9);
+  cootocsr<int,npy_cfloat_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7,arg8,arg9);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg7)->size(); 
@@ -7414,7 +7416,7 @@
   {
     int length = (arg9)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
-    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cfloat)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cfloat_wrapper)*length);	 
     delete arg9; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -7449,10 +7451,10 @@
   int arg3 ;
   int *arg4 ;
   int *arg5 ;
-  npy_cdouble *arg6 ;
+  npy_cdouble_wrapper *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 ;
+  std::vector<npy_cdouble_wrapper > *arg9 = (std::vector<npy_cdouble_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -7467,7 +7469,7 @@
   int is_new_object6 ;
   std::vector<int > *tmp7 ;
   std::vector<int > *tmp8 ;
-  std::vector<npy_cdouble > *tmp9 ;
+  std::vector<npy_cdouble_wrapper > *tmp9 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -7484,7 +7486,7 @@
     arg8 = tmp8; 
   }
   {
-    tmp9 = new std::vector<npy_cdouble>(); 
+    tmp9 = new std::vector<npy_cdouble_wrapper>(); 
     arg9 = tmp9; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
@@ -7525,9 +7527,9 @@
     };
     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;
+    arg6 = (npy_cdouble_wrapper*) array6->data;
   }
-  cootocsr<int,npy_cdouble >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble const (*))arg6,arg7,arg8,arg9);
+  cootocsr<int,npy_cdouble_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7,arg8,arg9);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg7)->size(); 
@@ -7546,7 +7548,7 @@
   {
     int length = (arg9)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
-    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cdouble)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cdouble_wrapper)*length);	 
     delete arg9; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -7808,7 +7810,7 @@
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'cootocsr'.\n  Possible C/C++ prototypes are:\n    cootocsr<(int,int)>(int const,int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    cootocsr<(int,long)>(int const,int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    cootocsr<(int,float)>(int const,int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    cootocsr<(int,double)>(int const,int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    cootocsr<(int,npy_cfloat)>(int const,int const,int const,int const [],int const [],npy_cfloat const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat > *)\n    cootocsr<(int,npy_cdouble)>(int const,int const,int const,int const [],int const [],npy_cdouble const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble > *)\n");
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'cootocsr'.\n  Possible C/C++ prototypes are:\n    cootocsr<(int,int)>(int const,int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    cootocsr<(int,long)>(int const,int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    cootocsr<(int,float)>(int const,int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    cootocsr<(int,double)>(int const,int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    cootocsr<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat_wrapper > *)\n    cootocsr<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble_wrapper > *)\n");
   return NULL;
 }
 
@@ -8348,10 +8350,10 @@
   int arg3 ;
   int *arg4 ;
   int *arg5 ;
-  npy_cfloat *arg6 ;
+  npy_cfloat_wrapper *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 ;
+  std::vector<npy_cfloat_wrapper > *arg9 = (std::vector<npy_cfloat_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -8366,7 +8368,7 @@
   int is_new_object6 ;
   std::vector<int > *tmp7 ;
   std::vector<int > *tmp8 ;
-  std::vector<npy_cfloat > *tmp9 ;
+  std::vector<npy_cfloat_wrapper > *tmp9 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -8383,7 +8385,7 @@
     arg8 = tmp8; 
   }
   {
-    tmp9 = new std::vector<npy_cfloat>(); 
+    tmp9 = new std::vector<npy_cfloat_wrapper>(); 
     arg9 = tmp9; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
@@ -8424,9 +8426,9 @@
     };
     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;
+    arg6 = (npy_cfloat_wrapper*) array6->data;
   }
-  cootocsc<int,npy_cfloat >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat const (*))arg6,arg7,arg8,arg9);
+  cootocsc<int,npy_cfloat_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7,arg8,arg9);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg7)->size(); 
@@ -8445,7 +8447,7 @@
   {
     int length = (arg9)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
-    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cfloat)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cfloat_wrapper)*length);	 
     delete arg9; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -8480,10 +8482,10 @@
   int arg3 ;
   int *arg4 ;
   int *arg5 ;
-  npy_cdouble *arg6 ;
+  npy_cdouble_wrapper *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 ;
+  std::vector<npy_cdouble_wrapper > *arg9 = (std::vector<npy_cdouble_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -8498,7 +8500,7 @@
   int is_new_object6 ;
   std::vector<int > *tmp7 ;
   std::vector<int > *tmp8 ;
-  std::vector<npy_cdouble > *tmp9 ;
+  std::vector<npy_cdouble_wrapper > *tmp9 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -8515,7 +8517,7 @@
     arg8 = tmp8; 
   }
   {
-    tmp9 = new std::vector<npy_cdouble>(); 
+    tmp9 = new std::vector<npy_cdouble_wrapper>(); 
     arg9 = tmp9; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cootocsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
@@ -8556,9 +8558,9 @@
     };
     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;
+    arg6 = (npy_cdouble_wrapper*) array6->data;
   }
-  cootocsc<int,npy_cdouble >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble const (*))arg6,arg7,arg8,arg9);
+  cootocsc<int,npy_cdouble_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7,arg8,arg9);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg7)->size(); 
@@ -8577,7 +8579,7 @@
   {
     int length = (arg9)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
-    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cdouble)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg9))[0]),sizeof(npy_cdouble_wrapper)*length);	 
     delete arg9; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -8839,7 +8841,7 @@
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'cootocsc'.\n  Possible C/C++ prototypes are:\n    cootocsc<(int,int)>(int const,int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    cootocsc<(int,long)>(int const,int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    cootocsc<(int,float)>(int const,int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    cootocsc<(int,double)>(int const,int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    cootocsc<(int,npy_cfloat)>(int const,int const,int const,int const [],int const [],npy_cfloat const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat > *)\n    cootocsc<(int,npy_cdouble)>(int const,int const,int const,int const [],int const [],npy_cdouble const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble > *)\n");
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'cootocsc'.\n  Possible C/C++ prototypes are:\n    cootocsc<(int,int)>(int const,int const,int const,int const [],int const [],int const [],std::vector<int > *,std::vector<int > *,std::vector<int > *)\n    cootocsc<(int,long)>(int const,int const,int const,int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    cootocsc<(int,float)>(int const,int const,int const,int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    cootocsc<(int,double)>(int const,int const,int const,int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    cootocsc<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat_wrapper > *)\n    cootocsc<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble_wrapper > *)\n");
   return NULL;
 }
 
@@ -9558,13 +9560,13 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cfloat *arg5 ;
+  npy_cfloat_wrapper *arg5 ;
   int *arg6 ;
   int *arg7 ;
-  npy_cfloat *arg8 ;
+  npy_cfloat_wrapper *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 ;
+  std::vector<npy_cfloat_wrapper > *arg11 = (std::vector<npy_cfloat_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -9583,7 +9585,7 @@
   int is_new_object8 ;
   std::vector<int > *tmp9 ;
   std::vector<int > *tmp10 ;
-  std::vector<npy_cfloat > *tmp11 ;
+  std::vector<npy_cfloat_wrapper > *tmp11 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -9602,7 +9604,7 @@
     arg10 = tmp10; 
   }
   {
-    tmp11 = new std::vector<npy_cfloat>(); 
+    tmp11 = new std::vector<npy_cfloat_wrapper>(); 
     arg11 = tmp11; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrmucsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
@@ -9638,7 +9640,7 @@
     };
     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;
+    arg5 = (npy_cfloat_wrapper*) array5->data;
   }
   {
     npy_intp size[1] = {
@@ -9662,9 +9664,9 @@
     };
     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;
+    arg8 = (npy_cfloat_wrapper*) array8->data;
   }
-  csrmucsr<int,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);
+  csrmucsr<int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg9)->size(); 
@@ -9683,7 +9685,7 @@
   {
     int length = (arg11)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
-    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat_wrapper)*length);	 
     delete arg11; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -9735,13 +9737,13 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cdouble *arg5 ;
+  npy_cdouble_wrapper *arg5 ;
   int *arg6 ;
   int *arg7 ;
-  npy_cdouble *arg8 ;
+  npy_cdouble_wrapper *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 ;
+  std::vector<npy_cdouble_wrapper > *arg11 = (std::vector<npy_cdouble_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -9760,7 +9762,7 @@
   int is_new_object8 ;
   std::vector<int > *tmp9 ;
   std::vector<int > *tmp10 ;
-  std::vector<npy_cdouble > *tmp11 ;
+  std::vector<npy_cdouble_wrapper > *tmp11 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -9779,7 +9781,7 @@
     arg10 = tmp10; 
   }
   {
-    tmp11 = new std::vector<npy_cdouble>(); 
+    tmp11 = new std::vector<npy_cdouble_wrapper>(); 
     arg11 = tmp11; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csrmucsr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
@@ -9815,7 +9817,7 @@
     };
     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;
+    arg5 = (npy_cdouble_wrapper*) array5->data;
   }
   {
     npy_intp size[1] = {
@@ -9839,9 +9841,9 @@
     };
     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;
+    arg8 = (npy_cdouble_wrapper*) array8->data;
   }
-  csrmucsr<int,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);
+  csrmucsr<int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg9)->size(); 
@@ -9860,7 +9862,7 @@
   {
     int length = (arg11)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
-    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cdouble)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cdouble_wrapper)*length);	 
     delete arg11; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -10194,7 +10196,7 @@
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csrmucsr'.\n  Possible C/C++ prototypes are:\n    csrmucsr<(int,int)>(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    csrmucsr<(int,long)>(int const,int const,int const [],int const [],long const [],int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    csrmucsr<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    csrmucsr<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    csrmucsr<(int,npy_cfloat)>(int const,int const,int const [],int const [],npy_cfloat const [],int const [],int const [],npy_cfloat const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat > *)\n    csrmucsr<(int,npy_cdouble)>(int const,int const,int const [],int const [],npy_cdouble const [],int const [],int const [],npy_cdouble const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble > *)\n");
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csrmucsr'.\n  Possible C/C++ prototypes are:\n    csrmucsr<(int,int)>(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    csrmucsr<(int,long)>(int const,int const,int const [],int const [],long const [],int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    csrmucsr<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    csrmucsr<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    csrmucsr<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat_wrapper > *)\n    csrmucsr<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble_wrapper > *)\n");
   return NULL;
 }
 
@@ -10913,13 +10915,13 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cfloat *arg5 ;
+  npy_cfloat_wrapper *arg5 ;
   int *arg6 ;
   int *arg7 ;
-  npy_cfloat *arg8 ;
+  npy_cfloat_wrapper *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 ;
+  std::vector<npy_cfloat_wrapper > *arg11 = (std::vector<npy_cfloat_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -10938,7 +10940,7 @@
   int is_new_object8 ;
   std::vector<int > *tmp9 ;
   std::vector<int > *tmp10 ;
-  std::vector<npy_cfloat > *tmp11 ;
+  std::vector<npy_cfloat_wrapper > *tmp11 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -10957,7 +10959,7 @@
     arg10 = tmp10; 
   }
   {
-    tmp11 = new std::vector<npy_cfloat>(); 
+    tmp11 = new std::vector<npy_cfloat_wrapper>(); 
     arg11 = tmp11; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscmucsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
@@ -10993,7 +10995,7 @@
     };
     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;
+    arg5 = (npy_cfloat_wrapper*) array5->data;
   }
   {
     npy_intp size[1] = {
@@ -11017,9 +11019,9 @@
     };
     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;
+    arg8 = (npy_cfloat_wrapper*) array8->data;
   }
-  cscmucsc<int,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);
+  cscmucsc<int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg9)->size(); 
@@ -11038,7 +11040,7 @@
   {
     int length = (arg11)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
-    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat_wrapper)*length);	 
     delete arg11; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -11090,13 +11092,13 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cdouble *arg5 ;
+  npy_cdouble_wrapper *arg5 ;
   int *arg6 ;
   int *arg7 ;
-  npy_cdouble *arg8 ;
+  npy_cdouble_wrapper *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 ;
+  std::vector<npy_cdouble_wrapper > *arg11 = (std::vector<npy_cdouble_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -11115,7 +11117,7 @@
   int is_new_object8 ;
   std::vector<int > *tmp9 ;
   std::vector<int > *tmp10 ;
-  std::vector<npy_cdouble > *tmp11 ;
+  std::vector<npy_cdouble_wrapper > *tmp11 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -11134,7 +11136,7 @@
     arg10 = tmp10; 
   }
   {
-    tmp11 = new std::vector<npy_cdouble>(); 
+    tmp11 = new std::vector<npy_cdouble_wrapper>(); 
     arg11 = tmp11; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:cscmucsc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
@@ -11170,7 +11172,7 @@
     };
     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;
+    arg5 = (npy_cdouble_wrapper*) array5->data;
   }
   {
     npy_intp size[1] = {
@@ -11194,9 +11196,9 @@
     };
     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;
+    arg8 = (npy_cdouble_wrapper*) array8->data;
   }
-  cscmucsc<int,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);
+  cscmucsc<int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg9)->size(); 
@@ -11215,7 +11217,7 @@
   {
     int length = (arg11)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CDOUBLE); 
-    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cdouble)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cdouble_wrapper)*length);	 
     delete arg11; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -11549,7 +11551,7 @@
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'cscmucsc'.\n  Possible C/C++ prototypes are:\n    cscmucsc<(int,int)>(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    cscmucsc<(int,long)>(int const,int const,int const [],int const [],long const [],int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    cscmucsc<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    cscmucsc<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    cscmucsc<(int,npy_cfloat)>(int const,int const,int const [],int const [],npy_cfloat const [],int const [],int const [],npy_cfloat const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat > *)\n    cscmucsc<(int,npy_cdouble)>(int const,int const,int const [],int const [],npy_cdouble const [],int const [],int const [],npy_cdouble const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble > *)\n");
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'cscmucsc'.\n  Possible C/C++ prototypes are:\n    cscmucsc<(int,int)>(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    cscmucsc<(int,long)>(int const,int const,int const [],int const [],long const [],int const [],int const [],long const [],std::vector<int > *,std::vector<int > *,std::vector<long > *)\n    cscmucsc<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],std::vector<int > *,std::vector<int > *,std::vector<float > *)\n    cscmucsc<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],std::vector<int > *,std::vector<int > *,std::vector<double > *)\n    cscmucsc<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cfloat_wrapper > *)\n    cscmucsc<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],std::vector<int > *,std::vector<int > *,std::vector<npy_cdouble_wrapper > *)\n");
   return NULL;
 }
 
@@ -12020,9 +12022,9 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cfloat *arg5 ;
-  npy_cfloat *arg6 ;
-  std::vector<npy_cfloat > *arg7 = (std::vector<npy_cfloat > *) 0 ;
+  npy_cfloat_wrapper *arg5 ;
+  npy_cfloat_wrapper *arg6 ;
+  std::vector<npy_cfloat_wrapper > *arg7 = (std::vector<npy_cfloat_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -12035,7 +12037,7 @@
   int is_new_object5 ;
   PyArrayObject *array6 = NULL ;
   int is_new_object6 ;
-  std::vector<npy_cfloat > *tmp7 ;
+  std::vector<npy_cfloat_wrapper > *tmp7 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -12044,7 +12046,7 @@
   PyObject * obj5 = 0 ;
   
   {
-    tmp7 = new std::vector<npy_cfloat>(); 
+    tmp7 = new std::vector<npy_cfloat_wrapper>(); 
     arg7 = tmp7; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
@@ -12080,7 +12082,7 @@
     };
     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;
+    arg5 = (npy_cfloat_wrapper*) array5->data;
   }
   {
     npy_intp size[1] = {
@@ -12088,14 +12090,14 @@
     };
     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;
+    arg6 = (npy_cfloat_wrapper*) array6->data;
   }
-  csrmux<int,npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,(npy_cfloat const (*))arg6,arg7);
+  csrmux<int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(npy_cfloat_wrapper 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);	 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(npy_cfloat_wrapper)*length);	 
     delete arg7; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -12135,9 +12137,9 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cdouble *arg5 ;
-  npy_cdouble *arg6 ;
-  std::vector<npy_cdouble > *arg7 = (std::vector<npy_cdouble > *) 0 ;
+  npy_cdouble_wrapper *arg5 ;
+  npy_cdouble_wrapper *arg6 ;
+  std::vector<npy_cdouble_wrapper > *arg7 = (std::vector<npy_cdouble_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -12150,7 +12152,7 @@
   int is_new_object5 ;
   PyArrayObject *array6 = NULL ;
   int is_new_object6 ;
-  std::vector<npy_cdouble > *tmp7 ;
+  std::vector<npy_cdouble_wrapper > *tmp7 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -12159,7 +12161,7 @@
   PyObject * obj5 = 0 ;
   
   {
-    tmp7 = new std::vector<npy_cdouble>(); 
+    tmp7 = new std::vector<npy_cdouble_wrapper>(); 
     arg7 = tmp7; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:csrmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
@@ -12195,7 +12197,7 @@
     };
     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;
+    arg5 = (npy_cdouble_wrapper*) array5->data;
   }
   {
     npy_intp size[1] = {
@@ -12203,14 +12205,14 @@
     };
     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;
+    arg6 = (npy_cdouble_wrapper*) array6->data;
   }
-  csrmux<int,npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,(npy_cdouble const (*))arg6,arg7);
+  csrmux<int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(npy_cdouble_wrapper 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);	 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(npy_cdouble_wrapper)*length);	 
     delete arg7; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -12472,7 +12474,7 @@
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csrmux'.\n  Possible C/C++ prototypes are:\n    csrmux<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],std::vector<int > *)\n    csrmux<(int,long)>(int const,int const,int const [],int const [],long const [],long const [],std::vector<long > *)\n    csrmux<(int,float)>(int const,int const,int const [],int const [],float const [],float const [],std::vector<float > *)\n    csrmux<(int,double)>(int const,int const,int const [],int const [],double const [],double const [],std::vector<double > *)\n    csrmux<(int,npy_cfloat)>(int const,int const,int const [],int const [],npy_cfloat const [],npy_cfloat const [],std::vector<npy_cfloat > *)\n    csrmux<(int,npy_cdouble)>(int const,int const,int const [],int const [],npy_cdouble const [],npy_cdouble const [],std::vector<npy_cdouble > *)\n");
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csrmux'.\n  Possible C/C++ prototypes are:\n    csrmux<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],std::vector<int > *)\n    csrmux<(int,long)>(int const,int const,int const [],int const [],long const [],long const [],std::vector<long > *)\n    csrmux<(int,float)>(int const,int const,int const [],int const [],float const [],float const [],std::vector<float > *)\n    csrmux<(int,double)>(int const,int const,int const [],int const [],double const [],double const [],std::vector<double > *)\n    csrmux<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper const [],std::vector<npy_cfloat_wrapper > *)\n    csrmux<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper const [],std::vector<npy_cdouble_wrapper > *)\n");
   return NULL;
 }
 
@@ -12943,9 +12945,9 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cfloat *arg5 ;
-  npy_cfloat *arg6 ;
-  std::vector<npy_cfloat > *arg7 = (std::vector<npy_cfloat > *) 0 ;
+  npy_cfloat_wrapper *arg5 ;
+  npy_cfloat_wrapper *arg6 ;
+  std::vector<npy_cfloat_wrapper > *arg7 = (std::vector<npy_cfloat_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -12958,7 +12960,7 @@
   int is_new_object5 ;
   PyArrayObject *array6 = NULL ;
   int is_new_object6 ;
-  std::vector<npy_cfloat > *tmp7 ;
+  std::vector<npy_cfloat_wrapper > *tmp7 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -12967,7 +12969,7 @@
   PyObject * obj5 = 0 ;
   
   {
-    tmp7 = new std::vector<npy_cfloat>(); 
+    tmp7 = new std::vector<npy_cfloat_wrapper>(); 
     arg7 = tmp7; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cscmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
@@ -13003,7 +13005,7 @@
     };
     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;
+    arg5 = (npy_cfloat_wrapper*) array5->data;
   }
   {
     npy_intp size[1] = {
@@ -13011,14 +13013,14 @@
     };
     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;
+    arg6 = (npy_cfloat_wrapper*) array6->data;
   }
-  cscmux<int,npy_cfloat >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat const (*))arg5,(npy_cfloat const (*))arg6,arg7);
+  cscmux<int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(npy_cfloat_wrapper 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);	 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(npy_cfloat_wrapper)*length);	 
     delete arg7; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -13058,9 +13060,9 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cdouble *arg5 ;
-  npy_cdouble *arg6 ;
-  std::vector<npy_cdouble > *arg7 = (std::vector<npy_cdouble > *) 0 ;
+  npy_cdouble_wrapper *arg5 ;
+  npy_cdouble_wrapper *arg6 ;
+  std::vector<npy_cdouble_wrapper > *arg7 = (std::vector<npy_cdouble_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -13073,7 +13075,7 @@
   int is_new_object5 ;
   PyArrayObject *array6 = NULL ;
   int is_new_object6 ;
-  std::vector<npy_cdouble > *tmp7 ;
+  std::vector<npy_cdouble_wrapper > *tmp7 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -13082,7 +13084,7 @@
   PyObject * obj5 = 0 ;
   
   {
-    tmp7 = new std::vector<npy_cdouble>(); 
+    tmp7 = new std::vector<npy_cdouble_wrapper>(); 
     arg7 = tmp7; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:cscmux",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
@@ -13118,7 +13120,7 @@
     };
     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;
+    arg5 = (npy_cdouble_wrapper*) array5->data;
   }
   {
     npy_intp size[1] = {
@@ -13126,14 +13128,14 @@
     };
     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;
+    arg6 = (npy_cdouble_wrapper*) array6->data;
   }
-  cscmux<int,npy_cdouble >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble const (*))arg5,(npy_cdouble const (*))arg6,arg7);
+  cscmux<int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(npy_cdouble_wrapper 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);	 
+    memcpy(PyArray_DATA(obj),&((*(arg7))[0]),sizeof(npy_cdouble_wrapper)*length);	 
     delete arg7; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -13395,7 +13397,7 @@
   }
   
 fail:
-  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'cscmux'.\n  Possible C/C++ prototypes are:\n    cscmux<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],std::vector<int > *)\n    cscmux<(int,long)>(int const,int const,int const [],int const [],long const [],long const [],std::vector<long > *)\n    cscmux<(int,float)>(int const,int const,int const [],int const [],float const [],float const [],std::vector<float > *)\n    cscmux<(int,double)>(int const,int const,int const [],int const [],double const [],double const [],std::vector<double > *)\n    cscmux<(int,npy_cfloat)>(int const,int const,int const [],int const [],npy_cfloat const [],npy_cfloat const [],std::vector<npy_cfloat > *)\n    cscmux<(int,npy_cdouble)>(int const,int const,int const [],int const [],npy_cdouble const [],npy_cdouble const [],std::vector<npy_cdouble > *)\n");
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'cscmux'.\n  Possible C/C++ prototypes are:\n    cscmux<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],std::vector<int > *)\n    cscmux<(int,long)>(int const,int const,int const [],int const [],long const [],long const [],std::vector<long > *)\n    cscmux<(int,float)>(int const,int const,int const [],int const [],float const [],float const [],std::vector<float > *)\n    cscmux<(int,double)>(int const,int const,int const [],int const [],double const [],double const [],std::vector<double > *)\n    cscmux<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper const [],std::vector<npy_cfloat_wrapper > *)\n    cscmux<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper const [],std::vector<npy_cdouble_wrapper > *)\n");
   return NULL;
 }
 
@@ -14114,13 +14116,13 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cfloat *arg5 ;
+  npy_cfloat_wrapper *arg5 ;
   int *arg6 ;
   int *arg7 ;
-  npy_cfloat *arg8 ;
+  npy_cfloat_wrapper *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 ;
+  std::vector<npy_cfloat_wrapper > *arg11 = (std::vector<npy_cfloat_wrapper > *) 0 ;
   int val1 ;
   int ecode1 = 0 ;
   int val2 ;
@@ -14139,7 +14141,7 @@
   int is_new_object8 ;
   std::vector<int > *tmp9 ;
   std::vector<int > *tmp10 ;
-  std::vector<npy_cfloat > *tmp11 ;
+  std::vector<npy_cfloat_wrapper > *tmp11 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
   PyObject * obj2 = 0 ;
@@ -14158,7 +14160,7 @@
     arg10 = tmp10; 
   }
   {
-    tmp11 = new std::vector<npy_cfloat>(); 
+    tmp11 = new std::vector<npy_cfloat_wrapper>(); 
     arg11 = tmp11; 
   }
   if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:csr_elmul_csr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
@@ -14194,7 +14196,7 @@
     };
     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;
+    arg5 = (npy_cfloat_wrapper*) array5->data;
   }
   {
     npy_intp size[1] = {
@@ -14218,9 +14220,9 @@
     };
     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;
+    arg8 = (npy_cfloat_wrapper*) array8->data;
   }
-  csr_elmul_csr<int,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);
+  csr_elmul_csr<int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11);
   resultobj = SWIG_Py_Void();
   {
     int length = (arg9)->size(); 
@@ -14239,7 +14241,7 @@
   {
     int length = (arg11)->size(); 
     PyObject *obj = PyArray_FromDims(1, &length, PyArray_CFLOAT); 
-    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat)*length);	 
+    memcpy(PyArray_DATA(obj),&((*(arg11))[0]),sizeof(npy_cfloat_wrapper)*length);	 
     delete arg11; 
     resultobj = helper_appendToTuple( resultobj, (PyObject *)obj ); 
   }
@@ -14291,13 +14293,13 @@
   int arg2 ;
   int *arg3 ;
   int *arg4 ;
-  npy_cdouble *arg5 ;
+  npy_cdouble_wrapper *arg5 ;
   int *arg6 ;
   int *arg7 ;
-  npy_cdouble *arg8 ;
+  npy_cdouble_wrapper *arg8 ;
   std::vector<int > *arg9 = (std::vector<int > *) 0 ;
   std::vector<int > *arg10 = (std::vector<int > *) 0 ;
-  std::vector<npy_cdouble > *arg11 =