From 449cc00244e7f4f965d722dd6d986868c21f0012 Mon Sep 17 00:00:00 2001
From: Fabian Pedregosa <fabian.pedregosa@inria.fr>
Date: Thu, 29 Apr 2010 06:59:48 +0000
Subject: [PATCH] Refactoring on the svm module.

Cleanup innecessary code in svm module, add docstring. Also simplify the bindings and avoid creating new objects in the wrap functions, pass arrays by reference whenever possible.

Change some names: SVC.rho_ --> SVC.intercept_

Also added tests.

git-svn-id: https://scikit-learn.svn.sourceforge.net/svnroot/scikit-learn/trunk@710 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8
---
 examples/run_all.sh                 |    7 +
 examples/svm/plot_svm_hyperplane.py |    2 +-
 scikits/learn/src/libsvm.c          | 5082 +++++++++++++++------------
 scikits/learn/src/libsvm.pyx        |   81 +-
 scikits/learn/src/libsvm_helper.c   |   39 +-
 scikits/learn/svm.py                |  204 +-
 scikits/learn/tests/test_svm.py     |  157 +-
 7 files changed, 3194 insertions(+), 2378 deletions(-)

diff --git a/examples/run_all.sh b/examples/run_all.sh
index cc40d77265..85a1f6dbba 100755
--- a/examples/run_all.sh
+++ b/examples/run_all.sh
@@ -6,3 +6,10 @@ for file in `ls *.py`; do
     python $file
 done
 
+for file in `ls svm/*.py`; do
+    python $file
+done
+
+for file in `ls em/*.py`; do
+    python $file
+done
diff --git a/examples/svm/plot_svm_hyperplane.py b/examples/svm/plot_svm_hyperplane.py
index f2e930552f..18858b73c3 100644
--- a/examples/svm/plot_svm_hyperplane.py
+++ b/examples/svm/plot_svm_hyperplane.py
@@ -22,7 +22,7 @@ clf.fit(X, Y)
 w = np.dot(clf.dual_coef_[0], clf.support_)
 a = -w[0]/w[1]
 xx = np.linspace(-5, 5)
-yy = a*xx + (clf.rho_[0])/w[1]
+yy = a*xx - (clf.intercept_[0])/w[1]
 
 # plot the parallels to the separating hyperplane that pass through the
 # support vectors
diff --git a/scikits/learn/src/libsvm.c b/scikits/learn/src/libsvm.c
index 53e46bec9c..17fb936b42 100644
--- a/scikits/learn/src/libsvm.c
+++ b/scikits/learn/src/libsvm.c
@@ -1,11 +1,11 @@
-/* Generated by Cython 0.11.2 on Thu Mar  4 17:07:19 2010 */
+/* Generated by Cython 0.12 on Tue Apr 27 19:58:59 2010 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "structmember.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#endif
+#else
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #endif
@@ -15,6 +15,7 @@
 #if PY_VERSION_HEX < 0x02040000
   #define METH_COEXIST 0
   #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
+  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
 #endif
 #if PY_VERSION_HEX < 0x02050000
   typedef int Py_ssize_t;
@@ -73,8 +74,13 @@
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
-  #define PyString_Type                PyBytes_Type
-  #define PyString_CheckExact          PyBytes_CheckExact
+  #define PyString_Type                PyUnicode_Type
+  #define PyString_CheckExact          PyUnicode_CheckExact
+#else
+  #define PyBytes_Type                 PyString_Type
+  #define PyBytes_CheckExact           PyString_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
   #define PyInt_Type                   PyLong_Type
   #define PyInt_Check(op)              PyLong_Check(op)
   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
@@ -89,9 +95,10 @@
   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
 #else
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define PyBytes_Type                 PyString_Type
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
 #endif
 #if PY_MAJOR_VERSION >= 3
   #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
@@ -133,11 +140,11 @@
 #include <math.h>
 #define __PYX_HAVE_API__libsvm
 #include "stdlib.h"
+#include "stdio.h"
 #include "numpy/arrayobject.h"
+#include "numpy/ufuncobject.h"
 #include "svm.h"
 #include "libsvm_helper.c"
-#define __PYX_USE_C99_COMPLEX defined(_Complex_I)
-
 
 #ifdef __GNUC__
 #define INLINE __inline__
@@ -147,11 +154,7 @@
 #define INLINE 
 #endif
 
-typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/
-
-
-
-static int __pyx_skip_dispatch = 0;
+typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
 
 
 /* Type Conversion Predeclarations */
@@ -166,6 +169,9 @@ static int __pyx_skip_dispatch = 0;
 #define __Pyx_PyBytes_AsString            PyBytes_AsString
 #endif
 
+#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
+#define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))
+
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
@@ -185,6 +191,40 @@ static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 #endif
 #endif
 
+
+#if !defined(T_ULONGLONG)
+#define __Pyx_T_UNSIGNED_INT(x) \
+        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
+        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
+        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
+#else
+#define __Pyx_T_UNSIGNED_INT(x) \
+        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
+        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
+        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
+        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
+#endif
+#if !defined(T_LONGLONG)
+#define __Pyx_T_SIGNED_INT(x) \
+        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
+        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+        ((sizeof(x) == sizeof(int))   ? T_INT : \
+        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
+#else
+#define __Pyx_T_SIGNED_INT(x) \
+        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
+        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+        ((sizeof(x) == sizeof(int))   ? T_INT : \
+        ((sizeof(x) == sizeof(long))  ? T_LONG : \
+        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
+#endif
+
+#define __Pyx_T_FLOATING(x) \
+        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
+        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))
+
 #if !defined(T_SIZET)
 #if !defined(T_ULONGLONG)
 #define T_SIZET \
@@ -222,44 +262,145 @@ static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 static PyObject *__pyx_m;
 static PyObject *__pyx_b;
 static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
 static int __pyx_lineno;
 static int __pyx_clineno = 0;
 static const char * __pyx_cfilenm= __FILE__;
 static const char *__pyx_filename;
 static const char **__pyx_f;
 
-static char __pyx_mdoc[] = "\nBinding for libsvm[1]\n---------------------\nWe do not use the binding that ships with libsvm because we need to\naccess svm_model.sv_coeff (and other fields), but libsvm does not\nprovide an accessor. Our solution is to export svm_model and access it\nmanually, this is done un function see svm_train_wrap.\n\nlibsvm uses an sparse representation for the training vectors. In\nmethod dense_to_sparse we translate a dense matrix representation as\nthose produced by NumPy to a sparse representation that libsvm can\nunderstand.\n\nWe define arrays to be the same type as those in libsvm, usually of \ntype C double and C int.\n\nLow-level memory management is done in libsvm_helper.c. If we happen\nto run out of memory a MemoryError will be raised. In practice this is\nnot very helpful since hight changes are malloc fails inside svm.cpp,\nwhere no sort of memory checks are done.\n\nThese are low-level routines, not meant to be used directly. See\nscikits.learn.svm for a higher-level API.\n\n[1] http://www.csie.ntu.edu.tw/~cjlin/libsvm/\n\nNotes\n-----\nMaybe we could speed it a bit further by decorating functions with\n@cython.boundscheck(False), but probably it is not worth since all\nwork is done in lisvm_helper.c\nAlso, the signature mode='c' is somewhat superficial, since we already\ncheck that arrays are C-contiguous in svm.py\n\nAuthors\n-------\n2010: Fabian Pedregosa <fabian.pedregosa@inria.fr>\n      Gael Varoquaux <gael.varoquaux@normalesup.org>\n";
 
+#if !defined(CYTHON_CCOMPLEX)
+  #if defined(__cplusplus)
+    #define CYTHON_CCOMPLEX 1
+  #elif defined(_Complex_I)
+    #define CYTHON_CCOMPLEX 1
+  #else
+    #define CYTHON_CCOMPLEX 0
+  #endif
+#endif
+
+#if CYTHON_CCOMPLEX
+  #ifdef __cplusplus
+    #include <complex>
+  #else
+    #include <complex.h>
+  #endif
+#endif
 
-#ifdef CYTHON_REFNANNY
-typedef struct {
-  void (*INCREF)(void*, PyObject*, int);
-  void (*DECREF)(void*, PyObject*, int);
-  void (*GOTREF)(void*, PyObject*, int);
-  void (*GIVEREF)(void*, PyObject*, int);
-  void* (*NewContext)(const char*, int, const char*);
-  void (*FinishContext)(void**);
-} __Pyx_RefnannyAPIStruct;
-static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
-#define __Pyx_ImportRefcountAPI(name)   (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI")
-#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r)
-#define __Pyx_SetupRefcountContext(name)   void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__)
-#define __Pyx_FinishRefcountContext()   __Pyx_Refnanny->FinishContext(&__pyx_refchk)
+typedef npy_int8 __pyx_t_5numpy_int8_t;
+
+typedef npy_int16 __pyx_t_5numpy_int16_t;
+
+typedef npy_int32 __pyx_t_5numpy_int32_t;
+
+typedef npy_int64 __pyx_t_5numpy_int64_t;
+
+typedef npy_uint8 __pyx_t_5numpy_uint8_t;
+
+typedef npy_uint16 __pyx_t_5numpy_uint16_t;
+
+typedef npy_uint32 __pyx_t_5numpy_uint32_t;
+
+typedef npy_uint64 __pyx_t_5numpy_uint64_t;
+
+typedef npy_float32 __pyx_t_5numpy_float32_t;
+
+typedef npy_float64 __pyx_t_5numpy_float64_t;
+
+typedef npy_long __pyx_t_5numpy_int_t;
+
+typedef npy_longlong __pyx_t_5numpy_long_t;
+
+typedef npy_intp __pyx_t_5numpy_intp_t;
+
+typedef npy_uintp __pyx_t_5numpy_uintp_t;
+
+typedef npy_ulong __pyx_t_5numpy_uint_t;
+
+typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
+
+typedef npy_double __pyx_t_5numpy_float_t;
+
+typedef npy_double __pyx_t_5numpy_double_t;
+
+typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+
+#if CYTHON_CCOMPLEX
+  #ifdef __cplusplus
+    typedef ::std::complex< float > __pyx_t_float_complex;
+  #else
+    typedef float _Complex __pyx_t_float_complex;
+  #endif
+#else
+    typedef struct { float real, imag; } __pyx_t_float_complex;
+#endif
+
+#if CYTHON_CCOMPLEX
+  #ifdef __cplusplus
+    typedef ::std::complex< double > __pyx_t_double_complex;
+  #else
+    typedef double _Complex __pyx_t_double_complex;
+  #endif
+#else
+    typedef struct { double real, imag; } __pyx_t_double_complex;
+#endif
+
+/* Type declarations */
+
+typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
+
+typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
+
+typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
+
+typedef npy_cdouble __pyx_t_5numpy_complex_t;
+
+#ifndef CYTHON_REFNANNY
+  #define CYTHON_REFNANNY 0
+#endif
+
+#if CYTHON_REFNANNY
+  typedef struct {
+    void (*INCREF)(void*, PyObject*, int);
+    void (*DECREF)(void*, PyObject*, int);
+    void (*GOTREF)(void*, PyObject*, int);
+    void (*GIVEREF)(void*, PyObject*, int);
+    void* (*SetupContext)(const char*, int, const char*);
+    void (*FinishContext)(void**);
+  } __Pyx_RefNannyAPIStruct;
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+  static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
+    PyObject *m = NULL, *p = NULL;
+    void *r = NULL;
+    m = PyImport_ImportModule((char *)modname);
+    if (!m) goto end;
+    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+    if (!p) goto end;
+    r = PyLong_AsVoidPtr(p);
+  end:
+    Py_XDECREF(p);
+    Py_XDECREF(m);
+    return (__Pyx_RefNannyAPIStruct *)r;
+  }
+  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
 #else
-#define __Pyx_INCREF(r) Py_INCREF(r)
-#define __Pyx_DECREF(r) Py_DECREF(r)
-#define __Pyx_GOTREF(r)
-#define __Pyx_GIVEREF(r)
-#define __Pyx_XDECREF(r) Py_XDECREF(r)
-#define __Pyx_SetupRefcountContext(name)
-#define __Pyx_FinishRefcountContext()
+  #define __Pyx_RefNannySetupContext(name)
+  #define __Pyx_RefNannyFinishContext()
+  #define __Pyx_INCREF(r) Py_INCREF(r)
+  #define __Pyx_DECREF(r) Py_DECREF(r)
+  #define __Pyx_GOTREF(r)
+  #define __Pyx_GIVEREF(r)
+  #define __Pyx_XDECREF(r) Py_XDECREF(r)
 #endif /* CYTHON_REFNANNY */
-#define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r)
-#define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r)
+#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
+#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
 
 static void __Pyx_RaiseDoubleKeywordsError(
     const char* func_name, PyObject* kw_name); /*proto*/
@@ -294,86 +435,25 @@ typedef struct {
 static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
 static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
 
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static INLINE long __Pyx_div_long(long, long); /* proto */
+
+static INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
 
 static void __Pyx_RaiseBufferFallbackError(void); /*proto*/
 
 static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
 
+static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
-static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
-    PyObject *r;
-    if (!j) return NULL;
-    r = PyObject_GetItem(o, j);
-    Py_DECREF(j);
-    return r;
-}
-
-
-#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-
-static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
-    if (likely(o != Py_None)) {
-        if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
-            PyObject *r = PyList_GET_ITEM(o, i);
-            Py_INCREF(r);
-            return r;
-        }
-        else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
-            PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
-            Py_INCREF(r);
-            return r;
-        }
-    }
-    return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
-}
-
-#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-
-static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
-    if (likely(o != Py_None)) {
-        if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
-            PyObject *r = PyTuple_GET_ITEM(o, i);
-            Py_INCREF(r);
-            return r;
-        }
-        else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
-            PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
-            Py_INCREF(r);
-            return r;
-        }
-    }
-    return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
-}
+static INLINE void __Pyx_RaiseTooManyValuesError(void);
 
+static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
+static int __Pyx_EndUnpack(PyObject *); /*proto*/
 
-#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
-                                                    __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \
-                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
+static INLINE void __Pyx_RaiseNoneNotIterableError(void);
 
-static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
-    PyObject *r;
-    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
-        r = PyList_GET_ITEM(o, i);
-        Py_INCREF(r);
-    }
-    else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
-        r = PyTuple_GET_ITEM(o, i);
-        Py_INCREF(r);
-    }
-    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
-        r = PySequence_GetItem(o, i);
-    }
-    else {
-        r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
-    }
-    return r;
-}
+static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/
 
 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
     const char *name, int exact); /*proto*/
@@ -394,221 +474,104 @@ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
-#if __PYX_USE_C99_COMPLEX
-    #define __Pyx_REAL_PART(z) __real__(z)
-    #define __Pyx_IMAG_PART(z) __imag__(z)
+static INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp);
+
+#if CYTHON_CCOMPLEX
+  #ifdef __cplusplus
+    #define __Pyx_CREAL(z) ((z).real())
+    #define __Pyx_CIMAG(z) ((z).imag())
+  #else
+    #define __Pyx_CREAL(z) (__real__(z))
+    #define __Pyx_CIMAG(z) (__imag__(z))
+  #endif
 #else
-    #define __Pyx_REAL_PART(z) ((z).real)
-    #define __Pyx_IMAG_PART(z) ((z).imag)
+    #define __Pyx_CREAL(z) ((z).real)
+    #define __Pyx_CIMAG(z) ((z).imag)
 #endif
 
-#define __pyx_PyObject_from_complex(z) PyComplex_FromDoubles((double)__Pyx_REAL_PART(z), (double)__Pyx_IMAG_PART(z))
-
-#if __PYX_USE_C99_COMPLEX
-
-    typedef float _Complex __pyx_t_float_complex;
-    static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
-      return x + y*(__pyx_t_float_complex)_Complex_I;
-    }
-    
-    #define __pyx_t_float_complex_is_zero(a) ((a) == 0)
-    #define __pyx_t_float_complex_eq(a, b) ((a) == (b))
-    #define __pyx_t_float_complex_add(a, b) ((a)+(b))
-    #define __pyx_t_float_complex_sub(a, b) ((a)-(b))
-    #define __pyx_t_float_complex_mul(a, b) ((a)*(b))
-    #define __pyx_t_float_complex_div(a, b) ((a)/(b))
-    #define __pyx_t_float_complex_neg(a) (-(a))
-
+#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
+    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
+    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
 #else
-
-    typedef struct { float real, imag; } __pyx_t_float_complex;
-    static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
-      __pyx_t_float_complex c; c.real = x; c.imag = y; return c;
-    }
-    
-    static INLINE int __pyx_t_float_complex_is_zero(__pyx_t_float_complex a) {
-       return (a.real == 0) & (a.imag == 0);
-    }
-
-    static INLINE int __pyx_t_float_complex_eq(__pyx_t_float_complex a, __pyx_t_float_complex b) {
-       return (a.real == b.real) & (a.imag == b.imag);
-    }
-
-    static INLINE __pyx_t_float_complex __pyx_t_float_complex_add(__pyx_t_float_complex a, __pyx_t_float_complex b) {
-        __pyx_t_float_complex z;
-        z.real = a.real + b.real;
-        z.imag = a.imag + b.imag;
-        return z;
-    }
-
-    static INLINE __pyx_t_float_complex __pyx_t_float_complex_sub(__pyx_t_float_complex a, __pyx_t_float_complex b) {
-        __pyx_t_float_complex z;
-        z.real = a.real - b.real;
-        z.imag = a.imag - b.imag;
-        return z;
-    }
-
-    static INLINE __pyx_t_float_complex __pyx_t_float_complex_mul(__pyx_t_float_complex a, __pyx_t_float_complex b) {
-        __pyx_t_float_complex z;
-        z.real = a.real * b.real - a.imag * b.imag;
-        z.imag = a.real * b.imag + a.imag * b.real;
-        return z;
-    }
-
-    static INLINE __pyx_t_float_complex __pyx_t_float_complex_div(__pyx_t_float_complex a, __pyx_t_float_complex b) {
-        __pyx_t_float_complex z;
-        float denom = b.real*b.real + b.imag*b.imag;
-        z.real = (a.real * b.real + a.imag * b.imag) / denom;
-        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
-        return z;
-    }
-
-    static INLINE __pyx_t_float_complex __pyx_t_float_complex_neg(__pyx_t_float_complex a) {
-        __pyx_t_float_complex z;
-        z.real = -a.real;
-        z.imag = -a.imag;
-        return z;
-    }
-
+    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
+    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
 #endif
 
-#if __PYX_USE_C99_COMPLEX
-
-    typedef double _Complex __pyx_t_double_complex;
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
-      return x + y*(__pyx_t_double_complex)_Complex_I;
-    }
-    
-    #define __pyx_t_double_complex_is_zero(a) ((a) == 0)
-    #define __pyx_t_double_complex_eq(a, b) ((a) == (b))
-    #define __pyx_t_double_complex_add(a, b) ((a)+(b))
-    #define __pyx_t_double_complex_sub(a, b) ((a)-(b))
-    #define __pyx_t_double_complex_mul(a, b) ((a)*(b))
-    #define __pyx_t_double_complex_div(a, b) ((a)/(b))
-    #define __pyx_t_double_complex_neg(a) (-(a))
-
+#if CYTHON_CCOMPLEX
+  #ifdef __cplusplus
+    static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+  #else
+    static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+  #endif
 #else
-
-    typedef struct { double real, imag; } __pyx_t_double_complex;
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
-      __pyx_t_double_complex c; c.real = x; c.imag = y; return c;
-    }
-    
-    static INLINE int __pyx_t_double_complex_is_zero(__pyx_t_double_complex a) {
-       return (a.real == 0) & (a.imag == 0);
-    }
-
-    static INLINE int __pyx_t_double_complex_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
-       return (a.real == b.real) & (a.imag == b.imag);
-    }
-
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_add(__pyx_t_double_complex a, __pyx_t_double_complex b) {
-        __pyx_t_double_complex z;
-        z.real = a.real + b.real;
-        z.imag = a.imag + b.imag;
-        return z;
-    }
-
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_sub(__pyx_t_double_complex a, __pyx_t_double_complex b) {
-        __pyx_t_double_complex z;
-        z.real = a.real - b.real;
-        z.imag = a.imag - b.imag;
-        return z;
-    }
-
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_mul(__pyx_t_double_complex a, __pyx_t_double_complex b) {
-        __pyx_t_double_complex z;
-        z.real = a.real * b.real - a.imag * b.imag;
-        z.imag = a.real * b.imag + a.imag * b.real;
-        return z;
-    }
-
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_div(__pyx_t_double_complex a, __pyx_t_double_complex b) {
-        __pyx_t_double_complex z;
-        double denom = b.real*b.real + b.imag*b.imag;
-        z.real = (a.real * b.real + a.imag * b.imag) / denom;
-        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
-        return z;
-    }
-
-    static INLINE __pyx_t_double_complex __pyx_t_double_complex_neg(__pyx_t_double_complex a) {
-        __pyx_t_double_complex z;
-        z.real = -a.real;
-        z.imag = -a.imag;
-        return z;
-    }
-
+    static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
 #endif
 
-#if __PYX_USE_C99_COMPLEX
-
-    typedef long double _Complex __pyx_t_long__double_complex;
-    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_from_parts(long double x, long double y) {
-      return x + y*(__pyx_t_long__double_complex)_Complex_I;
-    }
-    
-    #define __pyx_t_long__double_complex_is_zero(a) ((a) == 0)
-    #define __pyx_t_long__double_complex_eq(a, b) ((a) == (b))
-    #define __pyx_t_long__double_complex_add(a, b) ((a)+(b))
-    #define __pyx_t_long__double_complex_sub(a, b) ((a)-(b))
-    #define __pyx_t_long__double_complex_mul(a, b) ((a)*(b))
-    #define __pyx_t_long__double_complex_div(a, b) ((a)/(b))
-    #define __pyx_t_long__double_complex_neg(a) (-(a))
-
+#if CYTHON_CCOMPLEX
+    #define __Pyx_c_eqf(a, b)   ((a)==(b))
+    #define __Pyx_c_sumf(a, b)  ((a)+(b))
+    #define __Pyx_c_difff(a, b) ((a)-(b))
+    #define __Pyx_c_prodf(a, b) ((a)*(b))
+    #define __Pyx_c_quotf(a, b) ((a)/(b))
+    #define __Pyx_c_negf(a)     (-(a))
+  #ifdef __cplusplus
+    #define __Pyx_c_is_zerof(z) ((z)==(float)0)
+    #define __Pyx_c_conjf(z)    (::std::conj(z))
+    /*#define __Pyx_c_absf(z)     (::std::abs(z))*/
+  #else
+    #define __Pyx_c_is_zerof(z) ((z)==0)
+    #define __Pyx_c_conjf(z)    (conjf(z))
+    /*#define __Pyx_c_absf(z)     (cabsf(z))*/
+ #endif
 #else
+    static INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
+    static INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
+    static INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
+    static INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
+    static INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
+    static INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
+    static INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
+    static INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
+    /*static INLINE float __Pyx_c_absf(__pyx_t_float_complex);*/
+#endif
 
-    typedef struct { long double real, imag; } __pyx_t_long__double_complex;
-    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_from_parts(long double x, long double y) {
-      __pyx_t_long__double_complex c; c.real = x; c.imag = y; return c;
-    }
-    
-    static INLINE int __pyx_t_long__double_complex_is_zero(__pyx_t_long__double_complex a) {
-       return (a.real == 0) & (a.imag == 0);
-    }
-
-    static INLINE int __pyx_t_long__double_complex_eq(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) {
-       return (a.real == b.real) & (a.imag == b.imag);
-    }
-
-    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_add(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) {
-        __pyx_t_long__double_complex z;
-        z.real = a.real + b.real;
-        z.imag = a.imag + b.imag;
-        return z;
-    }
-
-    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_sub(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) {
-        __pyx_t_long__double_complex z;
-        z.real = a.real - b.real;
-        z.imag = a.imag - b.imag;
-        return z;
-    }
-
-    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_mul(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) {
-        __pyx_t_long__double_complex z;
-        z.real = a.real * b.real - a.imag * b.imag;
-        z.imag = a.real * b.imag + a.imag * b.real;
-        return z;
-    }
-
-    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_div(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) {
-        __pyx_t_long__double_complex z;
-        long double denom = b.real*b.real + b.imag*b.imag;
-        z.real = (a.real * b.real + a.imag * b.imag) / denom;
-        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
-        return z;
-    }
-
-    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_neg(__pyx_t_long__double_complex a) {
-        __pyx_t_long__double_complex z;
-        z.real = -a.real;
-        z.imag = -a.imag;
-        return z;
-    }
-
+#if CYTHON_CCOMPLEX
+  #ifdef __cplusplus
+    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+  #else
+    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+  #endif
+#else
+    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
 #endif
 
-static INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/
+#if CYTHON_CCOMPLEX
+    #define __Pyx_c_eq(a, b)   ((a)==(b))
+    #define __Pyx_c_sum(a, b)  ((a)+(b))
+    #define __Pyx_c_diff(a, b) ((a)-(b))
+    #define __Pyx_c_prod(a, b) ((a)*(b))
+    #define __Pyx_c_quot(a, b) ((a)/(b))
+    #define __Pyx_c_neg(a)     (-(a))
+  #ifdef __cplusplus
+    #define __Pyx_c_is_zero(z) ((z)==(double)0)
+    #define __Pyx_c_conj(z)    (::std::conj(z))
+    /*#define __Pyx_c_abs(z)     (::std::abs(z))*/
+  #else
+    #define __Pyx_c_is_zero(z) ((z)==0)
+    #define __Pyx_c_conj(z)    (conj(z))
+    /*#define __Pyx_c_abs(z)     (cabs(z))*/
+ #endif
+#else
+    static INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
+    static INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
+    static INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
+    static INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
+    static INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
+    static INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
+    static INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
+    static INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
+    /*static INLINE double __Pyx_c_abs(__pyx_t_double_complex);*/
+#endif
 
 static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
 
@@ -647,65 +610,31 @@ static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
 
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-
-/* Type declarations */
-
-typedef npy_int8 __pyx_t_5numpy_int8_t;
-
-typedef npy_int16 __pyx_t_5numpy_int16_t;
-
-typedef npy_int32 __pyx_t_5numpy_int32_t;
-
-typedef npy_int64 __pyx_t_5numpy_int64_t;
-
-typedef npy_uint8 __pyx_t_5numpy_uint8_t;
-
-typedef npy_uint16 __pyx_t_5numpy_uint16_t;
-
-typedef npy_uint32 __pyx_t_5numpy_uint32_t;
-
-typedef npy_uint64 __pyx_t_5numpy_uint64_t;
-
-typedef npy_float32 __pyx_t_5numpy_float32_t;
-
-typedef npy_float64 __pyx_t_5numpy_float64_t;
-
-typedef npy_complex64 __pyx_t_5numpy_complex64_t;
-
-typedef npy_complex128 __pyx_t_5numpy_complex128_t;
-
-typedef npy_long __pyx_t_5numpy_int_t;
-
-typedef npy_longlong __pyx_t_5numpy_long_t;
-
-typedef npy_ulong __pyx_t_5numpy_uint_t;
-
-typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
-
-typedef npy_double __pyx_t_5numpy_float_t;
-
-typedef npy_double __pyx_t_5numpy_double_t;
-
-typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
-
-typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
-
-typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
-
-typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
-
-typedef npy_cdouble __pyx_t_5numpy_complex_t;
 /* Module declarations from python_buffer */
 
+/* Module declarations from python_ref */
+
 /* Module declarations from stdlib */
 
+/* Module declarations from stdio */
+
 /* Module declarations from numpy */
 
 /* Module declarations from numpy */
 
 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
+static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
+static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *); /*proto*/
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *, PyObject *); /*proto*/
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *, PyObject *, PyObject *); /*proto*/
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
 static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
+static INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *, PyObject *); /*proto*/
+static INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); /*proto*/
 /* Module declarations from libsvm */
 
 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "numpy.float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), 'R' };
@@ -715,143 +644,172 @@ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float_t = { "numpy.float_
 int __pyx_module_is_main_libsvm = 0;
 
 /* Implementation of libsvm */
-static char __pyx_k___main__[] = "__main__";
-static PyObject *__pyx_kp___main__;
-static char __pyx_k_X[] = "X";
-static PyObject *__pyx_kp_X;
-static char __pyx_k_Y[] = "Y";
-static PyObject *__pyx_kp_Y;
-static char __pyx_k_svm_type[] = "svm_type";
-static PyObject *__pyx_kp_svm_type;
-static char __pyx_k_kernel_type[] = "kernel_type";
-static PyObject *__pyx_kp_kernel_type;
-static char __pyx_k_degree[] = "degree";
-static PyObject *__pyx_kp_degree;
-static char __pyx_k_gamma[] = "gamma";
-static PyObject *__pyx_kp_gamma;
-static char __pyx_k_coef0[] = "coef0";
-static PyObject *__pyx_kp_coef0;
-static char __pyx_k_eps[] = "eps";
-static PyObject *__pyx_kp_eps;
-static char __pyx_k_C[] = "C";
-static PyObject *__pyx_kp_C;
-static char __pyx_k_nr_weight[] = "nr_weight";
-static PyObject *__pyx_kp_nr_weight;
-static char __pyx_k_weight_label[] = "weight_label";
-static PyObject *__pyx_kp_weight_label;
-static char __pyx_k_weight[] = "weight";
-static PyObject *__pyx_kp_weight;
-static char __pyx_k_nu[] = "nu";
-static PyObject *__pyx_kp_nu;
-static char __pyx_k_cache_size[] = "cache_size";
-static PyObject *__pyx_kp_cache_size;
-static char __pyx_k_p[] = "p";
-static PyObject *__pyx_kp_p;
-static char __pyx_k_shrinking[] = "shrinking";
-static PyObject *__pyx_kp_shrinking;
-static char __pyx_k_probability[] = "probability";
-static PyObject *__pyx_kp_probability;
-static char __pyx_k_T[] = "T";
-static PyObject *__pyx_kp_T;
-static char __pyx_k_SV[] = "SV";
-static PyObject *__pyx_kp_SV;
-static char __pyx_k_sv_coef[] = "sv_coef";
-static PyObject *__pyx_kp_sv_coef;
-static char __pyx_k_rho[] = "rho";
-static PyObject *__pyx_kp_rho;
-static char __pyx_k_nr_class[] = "nr_class";
-static PyObject *__pyx_kp_nr_class;
-static char __pyx_k_nSV[] = "nSV";
-static PyObject *__pyx_kp_nSV;
-static char __pyx_k_label[] = "label";
-static PyObject *__pyx_kp_label;
-static char __pyx_k_probA[] = "probA";
-static PyObject *__pyx_kp_probA;
-static char __pyx_k_probB[] = "probB";
-static PyObject *__pyx_kp_probB;
-static char __pyx_k_numpy[] = "numpy";
-static PyObject *__pyx_kp_numpy;
-static char __pyx_k_np[] = "np";
-static PyObject *__pyx_kp_np;
-static char __pyx_k_MemoryError[] = "MemoryError";
-static PyObject *__pyx_kp_MemoryError;
-static char __pyx_k_ValueError[] = "ValueError";
-static PyObject *__pyx_kp_ValueError;
-static char __pyx_k_empty[] = "empty";
-static PyObject *__pyx_kp_empty;
-static char __pyx_k_zeros[] = "zeros";
-static PyObject *__pyx_kp_zeros;
-static char __pyx_k_dtype[] = "dtype";
-static PyObject *__pyx_kp_dtype;
-static char __pyx_k_66[] = "int32";
-static PyObject *__pyx_kp_66;
-static char __pyx_k_67[] = "float64";
-static PyObject *__pyx_kp_67;
 static PyObject *__pyx_builtin_MemoryError;
 static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_kp_65;
-static char __pyx_k_65[] = "Seems we've run out of of memory";
-static PyObject *__pyx_kp_68;
-static char __pyx_k_68[] = "We've run out of of memory";
-static PyObject *__pyx_kp_69;
-static char __pyx_k_69[] = "We've run out of of memory";
-static PyObject *__pyx_int_15;
-static char __pyx_k___getbuffer__[] = "__getbuffer__";
-static PyObject *__pyx_kp___getbuffer__;
-static char __pyx_k___releasebuffer__[] = "__releasebuffer__";
-static PyObject *__pyx_kp___releasebuffer__;
-static char __pyx_k_info[] = "info";
-static PyObject *__pyx_kp_info;
-static char __pyx_k_flags[] = "flags";
-static PyObject *__pyx_kp_flags;
-static char __pyx_k_range[] = "range";
-static PyObject *__pyx_kp_range;
-static char __pyx_k_itervalues[] = "itervalues";
-static PyObject *__pyx_kp_itervalues;
-static char __pyx_k_RuntimeError[] = "RuntimeError";
-static PyObject *__pyx_kp_RuntimeError;
-static PyObject *__pyx_kp_35;
-static PyObject *__pyx_kp_36;
-static PyObject *__pyx_kp_39;
-static PyObject *__pyx_kp_57;
 static PyObject *__pyx_builtin_range;
 static PyObject *__pyx_builtin_RuntimeError;
-static char __pyx_k_35[] = "ndarray is not C contiguous";
-static char __pyx_k_36[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_37[] = ">";
-static char __pyx_k_38[] = "<";
-static char __pyx_k_39[] = "Non-native byte order not supported";
-static char __pyx_k_40[] = "b";
-static char __pyx_k_41[] = "B";
-static char __pyx_k_42[] = "h";
-static char __pyx_k_43[] = "H";
-static char __pyx_k_44[] = "i";
-static char __pyx_k_45[] = "I";
-static char __pyx_k_46[] = "l";
-static char __pyx_k_47[] = "L";
-static char __pyx_k_48[] = "q";
-static char __pyx_k_49[] = "Q";
-static char __pyx_k_50[] = "f";
-static char __pyx_k_51[] = "d";
-static char __pyx_k_52[] = "g";
-static char __pyx_k_53[] = "Zf";
-static char __pyx_k_54[] = "Zd";
-static char __pyx_k_55[] = "Zg";
-static char __pyx_k_56[] = "O";
-static char __pyx_k_57[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_58[] = "^";
-static PyObject *__pyx_kp_59;
-static PyObject *__pyx_kp_62;
-static PyObject *__pyx_kp_63;
-static PyObject *__pyx_kp_64;
-static char __pyx_k_59[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_60[] = ">";
-static char __pyx_k_61[] = "<";
-static char __pyx_k_62[] = "Non-native byte order not supported";
-static char __pyx_k_63[] = "Format string allocated too short.";
-static char __pyx_k_64[] = "unknown dtype code in numpy.pxd (%d)";
-
-/* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":85
+static char __pyx_k_1[] = "Seems we've run out of of memory";
+static char __pyx_k_2[] = "We've run out of of memory";
+static char __pyx_k_3[] = "ndarray is not C contiguous";
+static char __pyx_k_4[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_5[] = "Non-native byte order not supported";
+static char __pyx_k_6[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_7[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_8[] = "Format string allocated too short.";
+static char __pyx_k_9[] = "\nBinding for libsvm[1]\n---------------------\nWe do not use the binding that ships with libsvm because we need to\naccess svm_model.sv_coeff (and other fields), but libsvm does not\nprovide an accessor. Our solution is to export svm_model and access it\nmanually, this is done un function see svm_train_wrap.\n\nlibsvm uses an sparse representation for the training vectors. In\nmethod dense_to_sparse we translate a dense matrix representation as\nthose produced by NumPy to a sparse representation that libsvm can\nunderstand.\n\nWe define arrays to be the same type as those in libsvm, usually of \ntype C double and C int.\n\nLow-level memory management is done in libsvm_helper.c. If we happen\nto run out of memory a MemoryError will be raised. In practice this is\nnot very helpful since hight changes are malloc fails inside svm.cpp,\nwhere no sort of memory checks are done.\n\nThese are low-level routines, not meant to be used directly. See\nscikits.learn.svm for a higher-level API.\n\n[1] http://www.csie.ntu.edu.tw/~cjlin/libsvm/\n\nNotes\n-----\nMaybe we could speed it a bit further by decorating functions with\n@cython.boundscheck(False), but probably it is not worth since all\nwork is done in lisvm_helper.c\nAlso, the signature mode='c' is somewhat superficial, since we already\ncheck that arrays are C-contiguous in svm.py\n\nAuthors\n-------\n2010: Fabian Pedregosa <fabian.pedregosa@inria.fr>\n      Gael Varoquaux <gael.varoquaux@normalesup.org>\n";
+static char __pyx_k_10[] = "train_wrap (line 85)";
+static char __pyx_k_11[] = "predict_from_model_wrap (line 197)";
+static char __pyx_k_12[] = "predict_from_model_wrap";
+static char __pyx_k_13[] = "predict_prob_from_model_wrap (line 260)";
+static char __pyx_k_14[] = "predict_prob_from_model_wrap";
+static char __pyx_k__B[] = "B";
+static char __pyx_k__C[] = "C";
+static char __pyx_k__H[] = "H";
+static char __pyx_k__I[] = "I";
+static char __pyx_k__L[] = "L";
+static char __pyx_k__O[] = "O";
+static char __pyx_k__Q[] = "Q";
+static char __pyx_k__T[] = "T";
+static char __pyx_k__X[] = "X";
+static char __pyx_k__Y[] = "Y";
+static char __pyx_k__b[] = "b";
+static char __pyx_k__d[] = "d";
+static char __pyx_k__f[] = "f";
+static char __pyx_k__g[] = "g";
+static char __pyx_k__h[] = "h";
+static char __pyx_k__i[] = "i";
+static char __pyx_k__l[] = "l";
+static char __pyx_k__p[] = "p";
+static char __pyx_k__q[] = "q";
+static char __pyx_k__SV[] = "SV";
+static char __pyx_k__Zd[] = "Zd";
+static char __pyx_k__Zf[] = "Zf";
+static char __pyx_k__Zg[] = "Zg";
+static char __pyx_k__np[] = "np";
+static char __pyx_k__nu[] = "nu";
+static char __pyx_k__buf[] = "buf";
+static char __pyx_k__eps[] = "eps";
+static char __pyx_k__nSV[] = "nSV";
+static char __pyx_k__obj[] = "obj";
+static char __pyx_k__base[] = "base";
+static char __pyx_k__data[] = "data";
+static char __pyx_k__ndim[] = "ndim";
+static char __pyx_k__coef0[] = "coef0";
+static char __pyx_k__descr[] = "descr";
+static char __pyx_k__dtype[] = "dtype";
+static char __pyx_k__empty[] = "empty";
+static char __pyx_k__gamma[] = "gamma";
+static char __pyx_k__int32[] = "int32";
+static char __pyx_k__label[] = "label";
+static char __pyx_k__names[] = "names";
+static char __pyx_k__numpy[] = "numpy";
+static char __pyx_k__probA[] = "probA";
+static char __pyx_k__probB[] = "probB";
+static char __pyx_k__range[] = "range";
+static char __pyx_k__shape[] = "shape";
+static char __pyx_k__degree[] = "degree";
+static char __pyx_k__fields[] = "fields";
+static char __pyx_k__format[] = "format";
+static char __pyx_k__resize[] = "resize";
+static char __pyx_k__weight[] = "weight";
+static char __pyx_k__float64[] = "float64";
+static char __pyx_k__strides[] = "strides";
+static char __pyx_k__sv_coef[] = "sv_coef";
+static char __pyx_k____main__[] = "__main__";
+static char __pyx_k____test__[] = "__test__";
+static char __pyx_k__itemsize[] = "itemsize";
+static char __pyx_k__readonly[] = "readonly";
+static char __pyx_k__refcheck[] = "refcheck";
+static char __pyx_k__svm_type[] = "svm_type";
+static char __pyx_k__type_num[] = "type_num";
+static char __pyx_k__byteorder[] = "byteorder";
+static char __pyx_k__intercept[] = "intercept";
+static char __pyx_k__nclass_SV[] = "nclass_SV";
+static char __pyx_k__nr_weight[] = "nr_weight";
+static char __pyx_k__shrinking[] = "shrinking";
+static char __pyx_k__ValueError[] = "ValueError";
+static char __pyx_k__cache_size[] = "cache_size";
+static char __pyx_k__suboffsets[] = "suboffsets";
+static char __pyx_k__train_wrap[] = "train_wrap";
+static char __pyx_k__MemoryError[] = "MemoryError";
+static char __pyx_k__kernel_type[] = "kernel_type";
+static char __pyx_k__probability[] = "probability";
+static char __pyx_k__RuntimeError[] = "RuntimeError";
+static char __pyx_k__weight_label[] = "weight_label";
+static PyObject *__pyx_kp_s_1;
+static PyObject *__pyx_kp_u_10;
+static PyObject *__pyx_kp_u_11;
+static PyObject *__pyx_n_s_12;
+static PyObject *__pyx_kp_u_13;
+static PyObject *__pyx_n_s_14;
+static PyObject *__pyx_kp_s_2;
+static PyObject *__pyx_kp_u_3;
+static PyObject *__pyx_kp_u_4;
+static PyObject *__pyx_kp_u_5;
+static PyObject *__pyx_kp_u_6;
+static PyObject *__pyx_kp_u_7;
+static PyObject *__pyx_kp_u_8;
+static PyObject *__pyx_n_s__C;
+static PyObject *__pyx_n_s__MemoryError;
+static PyObject *__pyx_n_s__RuntimeError;
+static PyObject *__pyx_n_s__SV;
+static PyObject *__pyx_n_s__T;
+static PyObject *__pyx_n_s__ValueError;
+static PyObject *__pyx_n_s__X;
+static PyObject *__pyx_n_s__Y;
+static PyObject *__pyx_n_s____main__;
+static PyObject *__pyx_n_s____test__;
+static PyObject *__pyx_n_s__base;
+static PyObject *__pyx_n_s__buf;
+static PyObject *__pyx_n_s__byteorder;
+static PyObject *__pyx_n_s__cache_size;
+static PyObject *__pyx_n_s__coef0;
+static PyObject *__pyx_n_s__data;
+static PyObject *__pyx_n_s__degree;
+static PyObject *__pyx_n_s__descr;
+static PyObject *__pyx_n_s__dtype;
+static PyObject *__pyx_n_s__empty;
+static PyObject *__pyx_n_s__eps;
+static PyObject *__pyx_n_s__fields;
+static PyObject *__pyx_n_s__float64;
+static PyObject *__pyx_n_s__format;
+static PyObject *__pyx_n_s__gamma;
+static PyObject *__pyx_n_s__int32;
+static PyObject *__pyx_n_s__intercept;
+static PyObject *__pyx_n_s__itemsize;
+static PyObject *__pyx_n_s__kernel_type;
+static PyObject *__pyx_n_s__label;
+static PyObject *__pyx_n_s__nSV;
+static PyObject *__pyx_n_s__names;
+static PyObject *__pyx_n_s__nclass_SV;
+static PyObject *__pyx_n_s__ndim;
+static PyObject *__pyx_n_s__np;
+static PyObject *__pyx_n_s__nr_weight;
+static PyObject *__pyx_n_s__nu;
+static PyObject *__pyx_n_s__numpy;
+static PyObject *__pyx_n_s__obj;
+static PyObject *__pyx_n_s__p;
+static PyObject *__pyx_n_s__probA;
+static PyObject *__pyx_n_s__probB;
+static PyObject *__pyx_n_s__probability;
+static PyObject *__pyx_n_s__range;
+static PyObject *__pyx_n_s__readonly;
+static PyObject *__pyx_n_s__refcheck;
+static PyObject *__pyx_n_s__resize;
+static PyObject *__pyx_n_s__shape;
+static PyObject *__pyx_n_s__shrinking;
+static PyObject *__pyx_n_s__strides;
+static PyObject *__pyx_n_s__suboffsets;
+static PyObject *__pyx_n_s__sv_coef;
+static PyObject *__pyx_n_s__svm_type;
+static PyObject *__pyx_n_s__train_wrap;
+static PyObject *__pyx_n_s__type_num;
+static PyObject *__pyx_n_s__weight;
+static PyObject *__pyx_n_s__weight_label;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_15;
+
+/* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":85
  * # Wrapper functions
  * 
  * def train_wrap (  np.ndarray[np.float64_t, ndim=2, mode='c'] X,             # <<<<<<<<<<<<<<
@@ -860,7 +818,7 @@ static char __pyx_k_64[] = "unknown dtype code in numpy.pxd (%d)";
  */
 
 static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6libsvm_train_wrap[] = "\n    Wrapper for svm_train in libsvm\n\n    Parameters\n    ----------\n    X: array-like, dtype=float, size=[N, D]\n\n    Y: array, dtype=float, size=[N]\n        target vector\n\n    Optional Parameters\n    -------------------\n    See scikits.learn.svm.predict for a complete list of parameters.\n\n    Return\n    ------\n    sv_coef: array of coeficients for support vector in decision\n            function (aka alphas)\n    rho : array\n        constants in decision functions\n    SV : array-like\n        support vectors\n    TODO\n    ";
+static char __pyx_doc_6libsvm_train_wrap[] = "\n    Wrap svm_train from libsvm\n\n    Parameters\n    ----------\n    X: array-like, dtype=float, size=[N, D]\n\n    Y: array, dtype=float, size=[N]\n        target vector\n\n    ...\n\n    Notes\n    -------------------\n    See scikits.learn.svm.predict for a complete list of parameters.\n\n    Return\n    ------\n    sv_coef: array of coeficients for support vector in decision\n            function (aka alphas)\n    intercept : array\n        constants in decision functions\n    SV : array-like\n        support vectors\n    TODO\n    ";
 static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyArrayObject *__pyx_v_X = 0;
   PyArrayObject *__pyx_v_Y = 0;
@@ -872,8 +830,12 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
   double __pyx_v_eps;
   double __pyx_v_C;
   int __pyx_v_nr_weight;
+  PyArrayObject *__pyx_v_SV = 0;
+  PyArrayObject *__pyx_v_sv_coef = 0;
+  PyArrayObject *__pyx_v_intercept = 0;
   PyArrayObject *__pyx_v_weight_label = 0;
   PyArrayObject *__pyx_v_weight = 0;
+  PyArrayObject *__pyx_v_nclass_SV = 0;
   double __pyx_v_nu;
   double __pyx_v_cache_size;
   double __pyx_v_p;
@@ -883,12 +845,8 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
   struct svm_problem *__pyx_v_problem;
   struct svm_model *__pyx_v_model;
   char *__pyx_v_error_msg;
-  int __pyx_v_nSV;
+  int __pyx_v_SV_len;
   int __pyx_v_nr;
-  PyArrayObject *__pyx_v_sv_coef;
-  PyArrayObject *__pyx_v_rho;
-  PyArrayObject *__pyx_v_SV;
-  PyArrayObject *__pyx_v_nclass_SV;
   PyArrayObject *__pyx_v_label;
   PyArrayObject *__pyx_v_probA;
   PyArrayObject *__pyx_v_probB;
@@ -898,28 +856,20 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
   Py_buffer __pyx_bstruct_weight_label;
   Py_ssize_t __pyx_bstride_0_weight_label = 0;
   Py_ssize_t __pyx_bshape_0_weight_label = 0;
-  Py_buffer __pyx_bstruct_probA;
-  Py_ssize_t __pyx_bstride_0_probA = 0;
-  Py_ssize_t __pyx_bshape_0_probA = 0;
-  Py_buffer __pyx_bstruct_probB;
-  Py_ssize_t __pyx_bstride_0_probB = 0;
-  Py_ssize_t __pyx_bshape_0_probB = 0;
-  Py_buffer __pyx_bstruct_label;
-  Py_ssize_t __pyx_bstride_0_label = 0;
-  Py_ssize_t __pyx_bshape_0_label = 0;
-  Py_buffer __pyx_bstruct_sv_coef;
-  Py_ssize_t __pyx_bstride_0_sv_coef = 0;
-  Py_ssize_t __pyx_bstride_1_sv_coef = 0;
-  Py_ssize_t __pyx_bshape_0_sv_coef = 0;
-  Py_ssize_t __pyx_bshape_1_sv_coef = 0;
-  Py_buffer __pyx_bstruct_rho;
-  Py_ssize_t __pyx_bstride_0_rho = 0;
-  Py_ssize_t __pyx_bshape_0_rho = 0;
   Py_buffer __pyx_bstruct_SV;
   Py_ssize_t __pyx_bstride_0_SV = 0;
   Py_ssize_t __pyx_bstride_1_SV = 0;
   Py_ssize_t __pyx_bshape_0_SV = 0;
   Py_ssize_t __pyx_bshape_1_SV = 0;
+  Py_buffer __pyx_bstruct_label;
+  Py_ssize_t __pyx_bstride_0_label = 0;
+  Py_ssize_t __pyx_bshape_0_label = 0;
+  Py_buffer __pyx_bstruct_probB;
+  Py_ssize_t __pyx_bstride_0_probB = 0;
+  Py_ssize_t __pyx_bshape_0_probB = 0;
+  Py_buffer __pyx_bstruct_intercept;
+  Py_ssize_t __pyx_bstride_0_intercept = 0;
+  Py_ssize_t __pyx_bshape_0_intercept = 0;
   Py_buffer __pyx_bstruct_Y;
   Py_ssize_t __pyx_bstride_0_Y = 0;
   Py_ssize_t __pyx_bshape_0_Y = 0;
@@ -931,32 +881,41 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
   Py_buffer __pyx_bstruct_nclass_SV;
   Py_ssize_t __pyx_bstride_0_nclass_SV = 0;
   Py_ssize_t __pyx_bshape_0_nclass_SV = 0;
+  Py_buffer __pyx_bstruct_sv_coef;
+  Py_ssize_t __pyx_bstride_0_sv_coef = 0;
+  Py_ssize_t __pyx_bstride_1_sv_coef = 0;
+  Py_ssize_t __pyx_bshape_0_sv_coef = 0;
+  Py_ssize_t __pyx_bshape_1_sv_coef = 0;
+  Py_buffer __pyx_bstruct_probA;
+  Py_ssize_t __pyx_bstride_0_probA = 0;
+  Py_ssize_t __pyx_bshape_0_probA = 0;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
-  PyObject *__pyx_2 = 0;
   int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
+  int __pyx_t_2;
+  int __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
-  PyArrayObject *__pyx_t_6 = NULL;
-  int __pyx_t_7;
+  PyObject *__pyx_t_6 = NULL;
+  PyObject *__pyx_t_7 = NULL;
   PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyArrayObject *__pyx_t_11 = NULL;
-  PyArrayObject *__pyx_t_12 = NULL;
-  PyArrayObject *__pyx_t_13 = NULL;
+  PyArrayObject *__pyx_t_9 = NULL;
+  int __pyx_t_10;
+  PyObject *__pyx_t_11 = NULL;
+  PyObject *__pyx_t_12 = NULL;
+  PyObject *__pyx_t_13 = NULL;
   PyArrayObject *__pyx_t_14 = NULL;
   PyArrayObject *__pyx_t_15 = NULL;
-  PyArrayObject *__pyx_t_16 = NULL;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_X,&__pyx_kp_Y,&__pyx_kp_svm_type,&__pyx_kp_kernel_type,&__pyx_kp_degree,&__pyx_kp_gamma,&__pyx_kp_coef0,&__pyx_kp_eps,&__pyx_kp_C,&__pyx_kp_nr_weight,&__pyx_kp_weight_label,&__pyx_kp_weight,&__pyx_kp_nu,&__pyx_kp_cache_size,&__pyx_kp_p,&__pyx_kp_shrinking,&__pyx_kp_probability,0};
-  __Pyx_SetupRefcountContext("train_wrap");
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__X,&__pyx_n_s__Y,&__pyx_n_s__svm_type,&__pyx_n_s__kernel_type,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__eps,&__pyx_n_s__C,&__pyx_n_s__nr_weight,&__pyx_n_s__SV,&__pyx_n_s__sv_coef,&__pyx_n_s__intercept,&__pyx_n_s__weight_label,&__pyx_n_s__weight,&__pyx_n_s__nclass_SV,&__pyx_n_s__nu,&__pyx_n_s__cache_size,&__pyx_n_s__p,&__pyx_n_s__shrinking,&__pyx_n_s__probability,0};
+  __Pyx_RefNannySetupContext("train_wrap");
   __pyx_self = __pyx_self;
   if (unlikely(__pyx_kwds)) {
     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
-    PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+    PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
     switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
+      case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
+      case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
+      case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
       case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
       case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
       case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
@@ -979,104 +938,128 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
     }
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  0:
-      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_X);
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__X);
       if (likely(values[0])) kw_args--;
       else goto __pyx_L5_argtuple_error;
       case  1:
-      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_Y);
+      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__Y);
       if (likely(values[1])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  2:
-      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_svm_type);
+      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__svm_type);
       if (likely(values[2])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  3:
-      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_kernel_type);
+      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kernel_type);
       if (likely(values[3])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  4:
-      values[4] = PyDict_GetItem(__pyx_kwds, __pyx_kp_degree);
+      values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__degree);
       if (likely(values[4])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  5:
-      values[5] = PyDict_GetItem(__pyx_kwds, __pyx_kp_gamma);
+      values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gamma);
       if (likely(values[5])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  6:
-      values[6] = PyDict_GetItem(__pyx_kwds, __pyx_kp_coef0);
+      values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coef0);
       if (likely(values[6])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  7:
-      values[7] = PyDict_GetItem(__pyx_kwds, __pyx_kp_eps);
+      values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eps);
       if (likely(values[7])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  8:
-      values[8] = PyDict_GetItem(__pyx_kwds, __pyx_kp_C);
+      values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__C);
       if (likely(values[8])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  9:
-      values[9] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nr_weight);
+      values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nr_weight);
       if (likely(values[9])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 10:
-      values[10] = PyDict_GetItem(__pyx_kwds, __pyx_kp_weight_label);
+      values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__SV);
       if (likely(values[10])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 11:
-      values[11] = PyDict_GetItem(__pyx_kwds, __pyx_kp_weight);
+      values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sv_coef);
       if (likely(values[11])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 12:
-      values[12] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nu);
+      values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__intercept);
       if (likely(values[12])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 13:
-      values[13] = PyDict_GetItem(__pyx_kwds, __pyx_kp_cache_size);
+      values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weight_label);
       if (likely(values[13])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 14:
-      values[14] = PyDict_GetItem(__pyx_kwds, __pyx_kp_p);
+      values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weight);
       if (likely(values[14])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 15:
-      values[15] = PyDict_GetItem(__pyx_kwds, __pyx_kp_shrinking);
+      values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nclass_SV);
       if (likely(values[15])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 16:
-      values[16] = PyDict_GetItem(__pyx_kwds, __pyx_kp_probability);
+      values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nu);
       if (likely(values[16])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case 17:
+      values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cache_size);
+      if (likely(values[17])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case 18:
+      values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p);
+      if (likely(values[18])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case 19:
+      values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shrinking);
+      if (likely(values[19])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case 20:
+      values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probability);
+      if (likely(values[20])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     }
     if (unlikely(kw_args > 0)) {
@@ -1092,14 +1075,18 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
     __pyx_v_eps = __pyx_PyFloat_AsDouble(values[7]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_C = __pyx_PyFloat_AsDouble(values[8]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_nr_weight = __Pyx_PyInt_AsInt(values[9]); if (unlikely((__pyx_v_nr_weight == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_weight_label = ((PyArrayObject *)values[10]);
-    __pyx_v_weight = ((PyArrayObject *)values[11]);
-    __pyx_v_nu = __pyx_PyFloat_AsDouble(values[12]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[13]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_p = __pyx_PyFloat_AsDouble(values[14]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[15]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_probability = __Pyx_PyInt_AsInt(values[16]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  } else if (PyTuple_GET_SIZE(__pyx_args) != 17) {
+    __pyx_v_SV = ((PyArrayObject *)values[10]);
+    __pyx_v_sv_coef = ((PyArrayObject *)values[11]);
+    __pyx_v_intercept = ((PyArrayObject *)values[12]);
+    __pyx_v_weight_label = ((PyArrayObject *)values[13]);
+    __pyx_v_weight = ((PyArrayObject *)values[14]);
+    __pyx_v_nclass_SV = ((PyArrayObject *)values[15]);
+    __pyx_v_nu = __pyx_PyFloat_AsDouble(values[16]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[17]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_p = __pyx_PyFloat_AsDouble(values[18]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[19]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_probability = __Pyx_PyInt_AsInt(values[20]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  } else if (PyTuple_GET_SIZE(__pyx_args) != 21) {
     goto __pyx_L5_argtuple_error;
   } else {
     __pyx_v_X = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0));
@@ -1112,43 +1099,55 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
     __pyx_v_eps = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 7)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_C = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 8)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_nr_weight = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 9)); if (unlikely((__pyx_v_nr_weight == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_weight_label = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 10));
-    __pyx_v_weight = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 11));
-    __pyx_v_nu = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 12)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 13)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_p = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 14)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_shrinking = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 15)); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_probability = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 16)); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_SV = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 10));
+    __pyx_v_sv_coef = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 11));
+    __pyx_v_intercept = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 12));
+    __pyx_v_weight_label = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 13));
+    __pyx_v_weight = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 14));
+    __pyx_v_nclass_SV = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 15));
+    __pyx_v_nu = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 16)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 17)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_p = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 18)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_shrinking = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 19)); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_probability = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 20)); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 17, 17, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("libsvm.train_wrap");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  __pyx_v_sv_coef = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
-  __pyx_v_rho = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
-  __pyx_v_SV = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
-  __pyx_v_nclass_SV = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
+  __Pyx_INCREF((PyObject *)__pyx_v_X);
+  __Pyx_INCREF((PyObject *)__pyx_v_Y);
+  __Pyx_INCREF((PyObject *)__pyx_v_SV);
+  __Pyx_INCREF((PyObject *)__pyx_v_sv_coef);
+  __Pyx_INCREF((PyObject *)__pyx_v_intercept);
+  __Pyx_INCREF((PyObject *)__pyx_v_weight_label);
+  __Pyx_INCREF((PyObject *)__pyx_v_weight);
+  __Pyx_INCREF((PyObject *)__pyx_v_nclass_SV);
   __pyx_v_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_probA = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_v_probB = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
-  __pyx_bstruct_sv_coef.buf = NULL;
-  __pyx_bstruct_rho.buf = NULL;
-  __pyx_bstruct_SV.buf = NULL;
-  __pyx_bstruct_nclass_SV.buf = NULL;
   __pyx_bstruct_label.buf = NULL;
   __pyx_bstruct_probA.buf = NULL;
   __pyx_bstruct_probB.buf = NULL;
   __pyx_bstruct_X.buf = NULL;
   __pyx_bstruct_Y.buf = NULL;
+  __pyx_bstruct_SV.buf = NULL;
+  __pyx_bstruct_sv_coef.buf = NULL;
+  __pyx_bstruct_intercept.buf = NULL;
   __pyx_bstruct_weight_label.buf = NULL;
   __pyx_bstruct_weight.buf = NULL;
+  __pyx_bstruct_nclass_SV.buf = NULL;
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Y), __pyx_ptype_5numpy_ndarray, 1, "Y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight_label), __pyx_ptype_5numpy_ndarray, 1, "weight_label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight), __pyx_ptype_5numpy_ndarray, 1, "weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV), __pyx_ptype_5numpy_ndarray, 1, "SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight_label), __pyx_ptype_5numpy_ndarray, 1, "weight_label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight), __pyx_ptype_5numpy_ndarray, 1, "weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nclass_SV), __pyx_ptype_5numpy_ndarray, 1, "nclass_SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_X, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -1163,18 +1162,42 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
   __pyx_bshape_0_Y = __pyx_bstruct_Y.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight_label, (PyObject*)__pyx_v_weight_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_SV, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __pyx_bstride_0_SV = __pyx_bstruct_SV.strides[0]; __pyx_bstride_1_SV = __pyx_bstruct_SV.strides[1];
+  __pyx_bshape_0_SV = __pyx_bstruct_SV.shape[0]; __pyx_bshape_1_SV = __pyx_bstruct_SV.shape[1];
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sv_coef, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __pyx_bstride_0_sv_coef = __pyx_bstruct_sv_coef.strides[0]; __pyx_bstride_1_sv_coef = __pyx_bstruct_sv_coef.strides[1];
+  __pyx_bshape_0_sv_coef = __pyx_bstruct_sv_coef.shape[0]; __pyx_bshape_1_sv_coef = __pyx_bstruct_sv_coef.shape[1];
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_intercept, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __pyx_bstride_0_intercept = __pyx_bstruct_intercept.strides[0];
+  __pyx_bshape_0_intercept = __pyx_bstruct_intercept.shape[0];
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight_label, (PyObject*)__pyx_v_weight_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_weight_label = __pyx_bstruct_weight_label.strides[0];
   __pyx_bshape_0_weight_label = __pyx_bstruct_weight_label.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight, (PyObject*)__pyx_v_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight, (PyObject*)__pyx_v_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_weight = __pyx_bstruct_weight.strides[0];
   __pyx_bshape_0_weight = __pyx_bstruct_weight.shape[0];
+  {
+    __Pyx_BufFmt_StackElem __pyx_stack[1];
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nclass_SV, (PyObject*)__pyx_v_nclass_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __pyx_bstride_0_nclass_SV = __pyx_bstruct_nclass_SV.strides[0];
+  __pyx_bshape_0_nclass_SV = __pyx_bstruct_nclass_SV.shape[0];
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":124
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":130
  * 
  *     # set libsvm problem
  *     problem = set_problem(X.data, Y.data, X.shape)             # <<<<<<<<<<<<<<
@@ -1183,7 +1206,7 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
  */
   __pyx_v_problem = set_problem(__pyx_v_X->data, __pyx_v_Y->data, __pyx_v_X->dimensions);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":130
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":136
  *                           coef0, nu, cache_size,
  *                           C, eps, p, shrinking, probability,
  *                           nr_weight, weight_label.data, weight.data)             # <<<<<<<<<<<<<<
@@ -1192,43 +1215,45 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
  */
   __pyx_v_param = set_parameter(__pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_eps, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, __pyx_v_nr_weight, __pyx_v_weight_label->data, __pyx_v_weight->data);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":133
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":139
  * 
  *     # check parameters
  *     if (param == NULL or problem == NULL):             # <<<<<<<<<<<<<<
  *         raise MemoryError("Seems we've run out of of memory")
  *     error_msg = svm_check_parameter(problem, param);
  */
-  if (!(__pyx_v_param == NULL)) {
-    __pyx_t_1 = (__pyx_v_problem == NULL);
+  __pyx_t_1 = (__pyx_v_param == NULL);
+  if (!__pyx_t_1) {
+    __pyx_t_2 = (__pyx_v_problem == NULL);
+    __pyx_t_3 = __pyx_t_2;
   } else {
-    __pyx_t_1 = (__pyx_v_param == NULL);
+    __pyx_t_3 = __pyx_t_1;
   }
-  if (__pyx_t_1) {
+  if (__pyx_t_3) {
 
-    /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":134
+    /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":140
  *     # check parameters
  *     if (param == NULL or problem == NULL):
  *         raise MemoryError("Seems we've run out of of memory")             # <<<<<<<<<<<<<<
  *     error_msg = svm_check_parameter(problem, param);
  *     if error_msg:
  */
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-    __Pyx_INCREF(__pyx_kp_65);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_65);
-    __Pyx_GIVEREF(__pyx_kp_65);
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
+    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_1));
+    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
+    __pyx_t_5 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_5, 0, 0);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L6;
   }
   __pyx_L6:;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":135
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":141
  *     if (param == NULL or problem == NULL):
  *         raise MemoryError("Seems we've run out of of memory")
  *     error_msg = svm_check_parameter(problem, param);             # <<<<<<<<<<<<<<
@@ -1237,17 +1262,17 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
  */
   __pyx_v_error_msg = svm_check_parameter(__pyx_v_problem, __pyx_v_param);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":136
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":142
  *         raise MemoryError("Seems we've run out of of memory")
  *     error_msg = svm_check_parameter(problem, param);
  *     if error_msg:             # <<<<<<<<<<<<<<
  *         free_problem(problem)
  *         free_param(param)
  */
-  __pyx_t_1 = (__pyx_v_error_msg != 0);
-  if (__pyx_t_1) {
+  __pyx_t_3 = (__pyx_v_error_msg != 0);
+  if (__pyx_t_3) {
 
-    /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":137
+    /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":143
  *     error_msg = svm_check_parameter(problem, param);
  *     if error_msg:
  *         free_problem(problem)             # <<<<<<<<<<<<<<
@@ -1256,7 +1281,7 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
  */
     free_problem(__pyx_v_problem);
 
-    /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":138
+    /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":144
  *     if error_msg:
  *         free_problem(problem)
  *         free_param(param)             # <<<<<<<<<<<<<<
@@ -1265,369 +1290,322 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
  */
     free_param(__pyx_v_param);
 
-    /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":139
+    /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":145
  *         free_problem(problem)
  *         free_param(param)
  *         raise ValueError(error_msg)             # <<<<<<<<<<<<<<
  * 
  *     # call svm_train, this does the real work
  */
-    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_5, 0, 0);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L7;
   }
   __pyx_L7:;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":142
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":148
  * 
  *     # call svm_train, this does the real work
  *     model = svm_train(problem, param)             # <<<<<<<<<<<<<<
  * 
- *     cdef int nSV = get_l(model)
+ *     cdef int SV_len = get_l(model)
  */
   __pyx_v_model = svm_train(__pyx_v_problem, __pyx_v_param);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":144
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":150
  *     model = svm_train(problem, param)
  * 
- *     cdef int nSV = get_l(model)             # <<<<<<<<<<<<<<
+ *     cdef int SV_len = get_l(model)             # <<<<<<<<<<<<<<
  *     cdef int nr = get_nr(model)
  * 
  */
-  __pyx_v_nSV = get_l(__pyx_v_model);
+  __pyx_v_SV_len = get_l(__pyx_v_model);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":145
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":151
  * 
- *     cdef int nSV = get_l(model)
+ *     cdef int SV_len = get_l(model)
  *     cdef int nr = get_nr(model)             # <<<<<<<<<<<<<<
  * 
  *     # copy model.sv_coef
  */
   __pyx_v_nr = get_nr(__pyx_v_model);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":149
- *     # copy model.sv_coef
- *     cdef np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef
- *     sv_coef = np.empty((nr-1, nSV))             # <<<<<<<<<<<<<<
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":156
+ *     # we create a new array instead of resizing, otherwise
+ *     # it would not erase previous information
+ *     sv_coef.resize((nr-1, SV_len), refcheck=False)             # <<<<<<<<<<<<<<
  *     copy_sv_coef(sv_coef.data, model, sv_coef.strides)
  * 
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_1);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_t_2 = PyInt_FromLong((__pyx_v_nr - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_nSV); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_sv_coef), __pyx_n_s__resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyInt_FromLong((__pyx_v_nr - 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
+  __pyx_t_6 = PyInt_FromLong(__pyx_v_SV_len); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
   __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_2 = 0;
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
   __pyx_t_4 = 0;
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
-  {
-    __Pyx_BufFmt_StackElem __pyx_stack[1];
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sv_coef);
-    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sv_coef, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
-    if (unlikely(__pyx_t_7 < 0)) {
-      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
-      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sv_coef, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
-        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
-        __Pyx_RaiseBufferFallbackError();
-      } else {
-        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
-      }
-    }
-    __pyx_bstride_0_sv_coef = __pyx_bstruct_sv_coef.strides[0]; __pyx_bstride_1_sv_coef = __pyx_bstruct_sv_coef.strides[1];
-    __pyx_bshape_0_sv_coef = __pyx_bstruct_sv_coef.shape[0]; __pyx_bshape_1_sv_coef = __pyx_bstruct_sv_coef.shape[1];
-    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
   __pyx_t_6 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_v_sv_coef));
-  __pyx_v_sv_coef = ((PyArrayObject *)__pyx_t_5);
-  __pyx_t_5 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
+  __pyx_t_7 = 0;
+  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
+  __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_6, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":150
- *     cdef np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef
- *     sv_coef = np.empty((nr-1, nSV))
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":157
+ *     # it would not erase previous information
+ *     sv_coef.resize((nr-1, SV_len), refcheck=False)
  *     copy_sv_coef(sv_coef.data, model, sv_coef.strides)             # <<<<<<<<<<<<<<
  * 
- *     # copy model.rho
+ *     # copy model.rho into the intercept
  */
   copy_sv_coef(__pyx_v_sv_coef->data, __pyx_v_model, __pyx_v_sv_coef->strides);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":154
- *     # copy model.rho
- *     cdef np.ndarray[np.float64_t, ndim=1, mode='c'] rho
- *     rho = np.empty(nr*(nr-1)/2)             # <<<<<<<<<<<<<<
- *     copy_rho(rho.data, model, rho.shape)
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":161
+ *     # copy model.rho into the intercept
+ *     # the intercept is just model.rho but with sign changed
+ *     intercept.resize(nr*(nr-1)/2, refcheck=False)             # <<<<<<<<<<<<<<
+ *     copy_intercept(intercept.data, model, intercept.shape)
  * 
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_1);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_t_4 = PyInt_FromLong(((__pyx_v_nr * (__pyx_v_nr - 1)) / 2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_intercept), __pyx_n_s__resize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_7 = PyInt_FromLong(__Pyx_div_long((__pyx_v_nr * (__pyx_v_nr - 1)), 2)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
+  __pyx_t_7 = 0;
+  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
+  __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_6, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
-  {
-    __Pyx_BufFmt_StackElem __pyx_stack[1];
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rho);
-    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_rho, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
-    if (unlikely(__pyx_t_7 < 0)) {
-      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
-      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_rho, (PyObject*)__pyx_v_rho, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
-        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
-        __Pyx_RaiseBufferFallbackError();
-      } else {
-        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
-      }
-    }
-    __pyx_bstride_0_rho = __pyx_bstruct_rho.strides[0];
-    __pyx_bshape_0_rho = __pyx_bstruct_rho.shape[0];
-    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __pyx_t_11 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_v_rho));
-  __pyx_v_rho = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":155
- *     cdef np.ndarray[np.float64_t, ndim=1, mode='c'] rho
- *     rho = np.empty(nr*(nr-1)/2)
- *     copy_rho(rho.data, model, rho.shape)             # <<<<<<<<<<<<<<
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":162
+ *     # the intercept is just model.rho but with sign changed
+ *     intercept.resize(nr*(nr-1)/2, refcheck=False)
+ *     copy_intercept(intercept.data, model, intercept.shape)             # <<<<<<<<<<<<<<
  * 
  *     # copy model.SV
  */
-  copy_rho(__pyx_v_rho->data, __pyx_v_model, __pyx_v_rho->dimensions);
+  copy_intercept(__pyx_v_intercept->data, __pyx_v_model, __pyx_v_intercept->dimensions);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":159
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":166
  *     # copy model.SV
- *     cdef np.ndarray[np.float64_t, ndim=2, mode='c'] SV
- *     SV = np.zeros((nSV, X.shape[1]))             # <<<<<<<<<<<<<<
- *     copy_SV(SV.data, model, SV.strides)
+ *     # we erase any previous information in SV
+ *     SV.resize((0,0), refcheck=False)             # <<<<<<<<<<<<<<
+ *     SV.resize((SV_len, X.shape[1]), refcheck=False)
+ *     copy_SV(SV.data, model, SV.shape)
+ */
+  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_SV), __pyx_n_s__resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_INCREF(__pyx_int_0);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_int_0);
+  __Pyx_GIVEREF(__pyx_int_0);
+  __Pyx_INCREF(__pyx_int_0);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_0);
+  __Pyx_GIVEREF(__pyx_int_0);
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
+  __pyx_t_7 = 0;
+  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
+  __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_6, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":167
+ *     # we erase any previous information in SV
+ *     SV.resize((0,0), refcheck=False)
+ *     SV.resize((SV_len, X.shape[1]), refcheck=False)             # <<<<<<<<<<<<<<
+ *     copy_SV(SV.data, model, SV.shape)
  * 
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_1);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_SV), __pyx_n_s__resize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_t_3 = PyInt_FromLong(__pyx_v_nSV); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyInt_FromLong((__pyx_v_X->dimensions[1])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyInt_FromLong(__pyx_v_SV_len); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_X->dimensions[1])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_7 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_5);
-  __pyx_t_3 = 0;
   __pyx_t_5 = 0;
-  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
-  __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_6, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
-  {
-    __Pyx_BufFmt_StackElem __pyx_stack[1];
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV);
-    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_SV, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
-    if (unlikely(__pyx_t_7 < 0)) {
-      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
-      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_SV, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
-        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
-        __Pyx_RaiseBufferFallbackError();
-      } else {
-        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
-      }
-    }
-    __pyx_bstride_0_SV = __pyx_bstruct_SV.strides[0]; __pyx_bstride_1_SV = __pyx_bstruct_SV.strides[1];
-    __pyx_bshape_0_SV = __pyx_bstruct_SV.shape[0]; __pyx_bshape_1_SV = __pyx_bstruct_SV.shape[1];
-    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __pyx_t_12 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_v_SV));
-  __pyx_v_SV = ((PyArrayObject *)__pyx_t_2);
-  __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":160
- *     cdef np.ndarray[np.float64_t, ndim=2, mode='c'] SV
- *     SV = np.zeros((nSV, X.shape[1]))
- *     copy_SV(SV.data, model, SV.strides)             # <<<<<<<<<<<<<<
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":168
+ *     SV.resize((0,0), refcheck=False)
+ *     SV.resize((SV_len, X.shape[1]), refcheck=False)
+ *     copy_SV(SV.data, model, SV.shape)             # <<<<<<<<<<<<<<
  * 
  *     # copy model.nSV
  */
-  copy_SV(__pyx_v_SV->data, __pyx_v_model, __pyx_v_SV->strides);
+  copy_SV(__pyx_v_SV->data, __pyx_v_model, __pyx_v_SV->dimensions);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":166
- *     # of support vectors
- *     cdef np.ndarray[np.int32_t, ndim=1, mode='c'] nclass_SV
- *     nclass_SV = np.empty((nr), dtype=np.int32)             # <<<<<<<<<<<<<<
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":172
+ *     # copy model.nSV
+ *     # TODO: do only in classification
+ *     nclass_SV.resize(nr, refcheck=False)             # <<<<<<<<<<<<<<
  *     copy_nSV(nclass_SV.data, model)
  * 
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_t_5 = PyInt_FromLong(__pyx_v_nr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_nclass_SV), __pyx_n_s__resize); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = PyInt_FromLong(__pyx_v_nr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_5);
   __pyx_t_5 = 0;
-  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_1));
-  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_2);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_2, __pyx_kp_66); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-  if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-  if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_13 = ((PyArrayObject *)__pyx_t_5);
-  {
-    __Pyx_BufFmt_StackElem __pyx_stack[1];
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nclass_SV);
-    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nclass_SV, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
-    if (unlikely(__pyx_t_7 < 0)) {
-      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
-      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nclass_SV, (PyObject*)__pyx_v_nclass_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
-        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
-        __Pyx_RaiseBufferFallbackError();
-      } else {
-        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
-      }
-    }
-    __pyx_bstride_0_nclass_SV = __pyx_bstruct_nclass_SV.strides[0];
-    __pyx_bshape_0_nclass_SV = __pyx_bstruct_nclass_SV.shape[0];
-    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __pyx_t_13 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_v_nclass_SV));
-  __pyx_v_nclass_SV = ((PyArrayObject *)__pyx_t_5);
-  __pyx_t_5 = 0;
+  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+  __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__refcheck), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":167
- *     cdef np.ndarray[np.int32_t, ndim=1, mode='c'] nclass_SV
- *     nclass_SV = np.empty((nr), dtype=np.int32)
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":173
+ *     # TODO: do only in classification
+ *     nclass_SV.resize(nr, refcheck=False)
  *     copy_nSV(nclass_SV.data, model)             # <<<<<<<<<<<<<<
  * 
  *     # copy label
  */
   copy_nSV(__pyx_v_nclass_SV->data, __pyx_v_model);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":171
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":177
  *     # copy label
  *     cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label
  *     label = np.empty((nr), dtype=np.int32)             # <<<<<<<<<<<<<<
  *     copy_label(label.data, model)
  * 
  */
-  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_2);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_nr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyInt_FromLong(__pyx_v_nr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
   __Pyx_GIVEREF(__pyx_t_4);
   __pyx_t_4 = 0;
-  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_1));
-  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_66); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-  if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__int32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_8);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_6, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_8);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-  if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label);
-    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_label, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
-    if (unlikely(__pyx_t_7 < 0)) {
-      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
+    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_label, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
+    if (unlikely(__pyx_t_10 < 0)) {
+      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_label, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
-        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
+        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
         __Pyx_RaiseBufferFallbackError();
       } else {
-        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
+        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
       }
     }
     __pyx_bstride_0_label = __pyx_bstruct_label.strides[0];
     __pyx_bshape_0_label = __pyx_bstruct_label.shape[0];
-    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_t_14 = 0;
+  __pyx_t_9 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_v_label));
-  __pyx_v_label = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_v_label = ((PyArrayObject *)__pyx_t_8);
+  __pyx_t_8 = 0;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":172
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":178
  *     cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label
  *     label = np.empty((nr), dtype=np.int32)
  *     copy_label(label.data, model)             # <<<<<<<<<<<<<<
@@ -1636,131 +1614,131 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
  */
   copy_label(__pyx_v_label->data, __pyx_v_model);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":177
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":183
  *     cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probA
  *     cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probB
  *     if probability != 0:             # <<<<<<<<<<<<<<
  *         # this is only valid for SVC
  *         probA = np.empty(nr*(nr-1)/2, dtype=np.float64)
  */
-  __pyx_t_1 = (__pyx_v_probability != 0);
-  if (__pyx_t_1) {
+  __pyx_t_3 = (__pyx_v_probability != 0);
+  if (__pyx_t_3) {
 
-    /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":179
+    /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":185
  *     if probability != 0:
  *         # this is only valid for SVC
  *         probA = np.empty(nr*(nr-1)/2, dtype=np.float64)             # <<<<<<<<<<<<<<
  *         probB = np.empty(nr*(nr-1)/2, dtype=np.float64)
  *         copy_probA(probA.data, model, probA.shape)
  */
-    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_2);
-    __pyx_t_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-    __pyx_t_2 = PyInt_FromLong(((__pyx_v_nr * (__pyx_v_nr - 1)) / 2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_1));
-    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_2);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_2, __pyx_kp_67); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-    if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __pyx_t_8 = PyInt_FromLong(__Pyx_div_long((__pyx_v_nr * (__pyx_v_nr - 1)), 2)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
+    __Pyx_GIVEREF(__pyx_t_8);
+    __pyx_t_8 = 0;
+    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
+    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_6, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-    if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_15 = ((PyArrayObject *)__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_14 = ((PyArrayObject *)__pyx_t_7);
     {
       __Pyx_BufFmt_StackElem __pyx_stack[1];
       __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA);
-      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
-      if (unlikely(__pyx_t_7 < 0)) {
-        PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
+      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
+      if (unlikely(__pyx_t_10 < 0)) {
+        PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
-          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
+          Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
           __Pyx_RaiseBufferFallbackError();
         } else {
-          PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
+          PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
         }
       }
       __pyx_bstride_0_probA = __pyx_bstruct_probA.strides[0];
       __pyx_bshape_0_probA = __pyx_bstruct_probA.shape[0];
-      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_t_15 = 0;
+    __pyx_t_14 = 0;
     __Pyx_DECREF(((PyObject *)__pyx_v_probA));
-    __pyx_v_probA = ((PyArrayObject *)__pyx_t_2);
-    __pyx_t_2 = 0;
+    __pyx_v_probA = ((PyArrayObject *)__pyx_t_7);
+    __pyx_t_7 = 0;
 
-    /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":180
+    /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":186
  *         # this is only valid for SVC
  *         probA = np.empty(nr*(nr-1)/2, dtype=np.float64)
  *         probB = np.empty(nr*(nr-1)/2, dtype=np.float64)             # <<<<<<<<<<<<<<
  *         copy_probA(probA.data, model, probA.shape)
  *         copy_probB(probB.data, model, probB.shape)
  */
-    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_2);
-    __pyx_t_2 = PyObject_GetAttr(__pyx_2, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-    __pyx_t_5 = PyInt_FromLong(((__pyx_v_nr * (__pyx_v_nr - 1)) / 2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __pyx_t_5 = 0;
-    __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_1));
-    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_2);
-    __pyx_t_5 = PyObject_GetAttr(__pyx_2, __pyx_kp_67); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = PyInt_FromLong(__Pyx_div_long((__pyx_v_nr * (__pyx_v_nr - 1)), 2)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
+    __Pyx_GIVEREF(__pyx_t_7);
+    __pyx_t_7 = 0;
+    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
+    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-    if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_8, __pyx_t_6, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-    if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_16 = ((PyArrayObject *)__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_15 = ((PyArrayObject *)__pyx_t_5);
     {
       __Pyx_BufFmt_StackElem __pyx_stack[1];
       __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probB);
-      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
-      if (unlikely(__pyx_t_7 < 0)) {
-        PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
+      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
+      if (unlikely(__pyx_t_10 < 0)) {
+        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
-          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
+          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
           __Pyx_RaiseBufferFallbackError();
         } else {
-          PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
+          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
         }
       }
       __pyx_bstride_0_probB = __pyx_bstruct_probB.strides[0];
       __pyx_bshape_0_probB = __pyx_bstruct_probB.shape[0];
-      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_t_16 = 0;
+    __pyx_t_15 = 0;
     __Pyx_DECREF(((PyObject *)__pyx_v_probB));
     __pyx_v_probB = ((PyArrayObject *)__pyx_t_5);
     __pyx_t_5 = 0;
 
-    /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":181
+    /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":187
  *         probA = np.empty(nr*(nr-1)/2, dtype=np.float64)
  *         probB = np.empty(nr*(nr-1)/2, dtype=np.float64)
  *         copy_probA(probA.data, model, probA.shape)             # <<<<<<<<<<<<<<
@@ -1769,7 +1747,7 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
  */
     copy_probA(__pyx_v_probA->data, __pyx_v_model, __pyx_v_probA->dimensions);
 
-    /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":182
+    /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":188
  *         probB = np.empty(nr*(nr-1)/2, dtype=np.float64)
  *         copy_probA(probA.data, model, probA.shape)
  *         copy_probB(probB.data, model, probB.shape)             # <<<<<<<<<<<<<<
@@ -1781,7 +1759,7 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
   }
   __pyx_L8:;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":184
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":190
  *         copy_probB(probB.data, model, probB.shape)
  * 
  *     free_model(model)             # <<<<<<<<<<<<<<
@@ -1790,7 +1768,7 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
  */
   free_model(__pyx_v_model);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":185
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":191
  * 
  *     free_model(model)
  *     free_problem(problem)             # <<<<<<<<<<<<<<
@@ -1799,77 +1777,59 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
  */
   free_problem(__pyx_v_problem);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":186
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":192
  *     free_model(model)
  *     free_problem(problem)
  *     free_param(param)             # <<<<<<<<<<<<<<
  * 
- *     return sv_coef, rho, SV, nr, nclass_SV, label, probA, probB
+ *     return label, probA, probB
  */
   free_param(__pyx_v_param);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":188
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":194
  *     free_param(param)
  * 
- *     return sv_coef, rho, SV, nr, nclass_SV, label, probA, probB             # <<<<<<<<<<<<<<
+ *     return label, probA, probB             # <<<<<<<<<<<<<<
  * 
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = PyInt_FromLong(__pyx_v_nr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_4 = PyTuple_New(8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  __Pyx_INCREF(((PyObject *)__pyx_v_sv_coef));
-  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_sv_coef));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_sv_coef));
-  __Pyx_INCREF(((PyObject *)__pyx_v_rho));
-  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_rho));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_rho));
-  __Pyx_INCREF(((PyObject *)__pyx_v_SV));
-  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_SV));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_SV));
-  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_5);
-  __Pyx_INCREF(((PyObject *)__pyx_v_nclass_SV));
-  PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_v_nclass_SV));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_nclass_SV));
   __Pyx_INCREF(((PyObject *)__pyx_v_label));
-  PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_v_label));
+  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_label));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_label));
   __Pyx_INCREF(((PyObject *)__pyx_v_probA));
-  PyTuple_SET_ITEM(__pyx_t_4, 6, ((PyObject *)__pyx_v_probA));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_probA));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_probA));
   __Pyx_INCREF(((PyObject *)__pyx_v_probB));
-  PyTuple_SET_ITEM(__pyx_t_4, 7, ((PyObject *)__pyx_v_probB));
+  PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_probB));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_probB));
+  __pyx_r = __pyx_t_5;
   __pyx_t_5 = 0;
-  __pyx_r = ((PyObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
-  __Pyx_XDECREF(__pyx_2);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_weight);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_weight_label);
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA);
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probB);
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label);
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sv_coef);
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rho);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV);
+    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label);
+    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probB);
+    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_intercept);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_Y);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_X);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nclass_SV);
+    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sv_coef);
+    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA);
   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
   __Pyx_AddTraceback("libsvm.train_wrap");
   __pyx_r = NULL;
@@ -1877,29 +1837,33 @@ static PyObject *__pyx_pf_6libsvm_train_wrap(PyObject *__pyx_self, PyObject *__p
   __pyx_L0:;
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_weight);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_weight_label);
-  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA);
-  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probB);
-  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label);
-  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sv_coef);
-  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rho);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV);
+  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label);
+  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probB);
+  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_intercept);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_Y);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_X);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nclass_SV);
+  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sv_coef);
+  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA);
   __pyx_L2:;
-  __Pyx_DECREF((PyObject *)__pyx_v_sv_coef);
-  __Pyx_DECREF((PyObject *)__pyx_v_rho);
-  __Pyx_DECREF((PyObject *)__pyx_v_SV);
-  __Pyx_DECREF((PyObject *)__pyx_v_nclass_SV);
   __Pyx_DECREF((PyObject *)__pyx_v_label);
   __Pyx_DECREF((PyObject *)__pyx_v_probA);
   __Pyx_DECREF((PyObject *)__pyx_v_probB);
+  __Pyx_DECREF((PyObject *)__pyx_v_X);
+  __Pyx_DECREF((PyObject *)__pyx_v_Y);
+  __Pyx_DECREF((PyObject *)__pyx_v_SV);
+  __Pyx_DECREF((PyObject *)__pyx_v_sv_coef);
+  __Pyx_DECREF((PyObject *)__pyx_v_intercept);
+  __Pyx_DECREF((PyObject *)__pyx_v_weight_label);
+  __Pyx_DECREF((PyObject *)__pyx_v_weight);
+  __Pyx_DECREF((PyObject *)__pyx_v_nclass_SV);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":191
+/* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":197
  * 
  * 
  * def predict_from_model_wrap(np.ndarray[np.float64_t, ndim=2, mode='c'] T,             # <<<<<<<<<<<<<<
@@ -1913,7 +1877,7 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
   PyArrayObject *__pyx_v_T = 0;
   PyArrayObject *__pyx_v_SV = 0;
   PyArrayObject *__pyx_v_sv_coef = 0;
-  PyArrayObject *__pyx_v_rho = 0;
+  PyArrayObject *__pyx_v_intercept = 0;
   int __pyx_v_svm_type;
   int __pyx_v_kernel_type;
   int __pyx_v_degree;
@@ -1929,7 +1893,6 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
   double __pyx_v_p;
   int __pyx_v_shrinking;
   int __pyx_v_probability;
-  int __pyx_v_nr_class;
   PyArrayObject *__pyx_v_nSV = 0;
   PyArrayObject *__pyx_v_label = 0;
   PyArrayObject *__pyx_v_probA = 0;
@@ -1960,14 +1923,14 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
   Py_ssize_t __pyx_bstride_1_sv_coef = 0;
   Py_ssize_t __pyx_bshape_0_sv_coef = 0;
   Py_ssize_t __pyx_bshape_1_sv_coef = 0;
+  Py_buffer __pyx_bstruct_intercept;
+  Py_ssize_t __pyx_bstride_0_intercept = 0;
+  Py_ssize_t __pyx_bshape_0_intercept = 0;
   Py_buffer __pyx_bstruct_T;
   Py_ssize_t __pyx_bstride_0_T = 0;
   Py_ssize_t __pyx_bstride_1_T = 0;
   Py_ssize_t __pyx_bshape_0_T = 0;
   Py_ssize_t __pyx_bshape_1_T = 0;
-  Py_buffer __pyx_bstruct_rho;
-  Py_ssize_t __pyx_bstride_0_rho = 0;
-  Py_ssize_t __pyx_bshape_0_rho = 0;
   Py_buffer __pyx_bstruct_nSV;
   Py_ssize_t __pyx_bstride_0_nSV = 0;
   Py_ssize_t __pyx_bshape_0_nSV = 0;
@@ -1977,7 +1940,6 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
   Py_ssize_t __pyx_bshape_0_SV = 0;
   Py_ssize_t __pyx_bshape_1_SV = 0;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
@@ -1987,14 +1949,13 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
   PyObject *__pyx_t_7 = NULL;
   PyObject *__pyx_t_8 = NULL;
   int __pyx_t_9;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_T,&__pyx_kp_SV,&__pyx_kp_sv_coef,&__pyx_kp_rho,&__pyx_kp_svm_type,&__pyx_kp_kernel_type,&__pyx_kp_degree,&__pyx_kp_gamma,&__pyx_kp_coef0,&__pyx_kp_eps,&__pyx_kp_C,&__pyx_kp_nr_weight,&__pyx_kp_weight_label,&__pyx_kp_weight,&__pyx_kp_nu,&__pyx_kp_cache_size,&__pyx_kp_p,&__pyx_kp_shrinking,&__pyx_kp_probability,&__pyx_kp_nr_class,&__pyx_kp_nSV,&__pyx_kp_label,&__pyx_kp_probA,&__pyx_kp_probB,0};
-  __Pyx_SetupRefcountContext("predict_from_model_wrap");
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__T,&__pyx_n_s__SV,&__pyx_n_s__sv_coef,&__pyx_n_s__intercept,&__pyx_n_s__svm_type,&__pyx_n_s__kernel_type,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__eps,&__pyx_n_s__C,&__pyx_n_s__nr_weight,&__pyx_n_s__weight_label,&__pyx_n_s__weight,&__pyx_n_s__nu,&__pyx_n_s__cache_size,&__pyx_n_s__p,&__pyx_n_s__shrinking,&__pyx_n_s__probability,&__pyx_n_s__nSV,&__pyx_n_s__label,&__pyx_n_s__probA,&__pyx_n_s__probB,0};
+  __Pyx_RefNannySetupContext("predict_from_model_wrap");
   __pyx_self = __pyx_self;
   if (unlikely(__pyx_kwds)) {
     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
-    PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+    PyObject* values[23] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
     switch (PyTuple_GET_SIZE(__pyx_args)) {
-      case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
       case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
       case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
       case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
@@ -2023,336 +1984,338 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
     }
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  0:
-      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_T);
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__T);
       if (likely(values[0])) kw_args--;
       else goto __pyx_L5_argtuple_error;
       case  1:
-      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_SV);
+      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__SV);
       if (likely(values[1])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  2:
-      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_sv_coef);
+      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sv_coef);
       if (likely(values[2])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  3:
-      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_rho);
+      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__intercept);
       if (likely(values[3])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  4:
-      values[4] = PyDict_GetItem(__pyx_kwds, __pyx_kp_svm_type);
+      values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__svm_type);
       if (likely(values[4])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  5:
-      values[5] = PyDict_GetItem(__pyx_kwds, __pyx_kp_kernel_type);
+      values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kernel_type);
       if (likely(values[5])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  6:
-      values[6] = PyDict_GetItem(__pyx_kwds, __pyx_kp_degree);
+      values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__degree);
       if (likely(values[6])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  7:
-      values[7] = PyDict_GetItem(__pyx_kwds, __pyx_kp_gamma);
+      values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gamma);
       if (likely(values[7])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  8:
-      values[8] = PyDict_GetItem(__pyx_kwds, __pyx_kp_coef0);
+      values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coef0);
       if (likely(values[8])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  9:
-      values[9] = PyDict_GetItem(__pyx_kwds, __pyx_kp_eps);
+      values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eps);
       if (likely(values[9])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 10:
-      values[10] = PyDict_GetItem(__pyx_kwds, __pyx_kp_C);
+      values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__C);
       if (likely(values[10])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 11:
-      values[11] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nr_weight);
+      values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nr_weight);
       if (likely(values[11])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 12:
-      values[12] = PyDict_GetItem(__pyx_kwds, __pyx_kp_weight_label);
+      values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weight_label);
       if (likely(values[12])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 13:
-      values[13] = PyDict_GetItem(__pyx_kwds, __pyx_kp_weight);
+      values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weight);
       if (likely(values[13])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 14:
-      values[14] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nu);
+      values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nu);
       if (likely(values[14])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 15:
-      values[15] = PyDict_GetItem(__pyx_kwds, __pyx_kp_cache_size);
+      values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cache_size);
       if (likely(values[15])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 16:
-      values[16] = PyDict_GetItem(__pyx_kwds, __pyx_kp_p);
+      values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p);
       if (likely(values[16])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 17:
-      values[17] = PyDict_GetItem(__pyx_kwds, __pyx_kp_shrinking);
+      values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shrinking);
       if (likely(values[17])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 18:
-      values[18] = PyDict_GetItem(__pyx_kwds, __pyx_kp_probability);
+      values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probability);
       if (likely(values[18])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 19:
-      values[19] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nr_class);
+      values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nSV);
       if (likely(values[19])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 20:
-      values[20] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nSV);
+      values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__label);
       if (likely(values[20])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 21:
-      values[21] = PyDict_GetItem(__pyx_kwds, __pyx_kp_label);
+      values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probA);
       if (likely(values[21])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 22:
-      values[22] = PyDict_GetItem(__pyx_kwds, __pyx_kp_probA);
+      values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probB);
       if (likely(values[22])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-      case 23:
-      values[23] = PyDict_GetItem(__pyx_kwds, __pyx_kp_probB);
-      if (likely(values[23])) kw_args--;
-      else {
-        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, 23); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "predict_from_model_wrap") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "predict_from_model_wrap") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_T = ((PyArrayObject *)values[0]);
     __pyx_v_SV = ((PyArrayObject *)values[1]);
     __pyx_v_sv_coef = ((PyArrayObject *)values[2]);
-    __pyx_v_rho = ((PyArrayObject *)values[3]);
-    __pyx_v_svm_type = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_kernel_type = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_degree = __Pyx_PyInt_AsInt(values[6]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[7]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[8]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_eps = __pyx_PyFloat_AsDouble(values[9]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_C = __pyx_PyFloat_AsDouble(values[10]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nr_weight = __Pyx_PyInt_AsInt(values[11]); if (unlikely((__pyx_v_nr_weight == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_intercept = ((PyArrayObject *)values[3]);
+    __pyx_v_svm_type = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_kernel_type = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_degree = __Pyx_PyInt_AsInt(values[6]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[7]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[8]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_eps = __pyx_PyFloat_AsDouble(values[9]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_C = __pyx_PyFloat_AsDouble(values[10]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_nr_weight = __Pyx_PyInt_AsInt(values[11]); if (unlikely((__pyx_v_nr_weight == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_weight_label = ((PyArrayObject *)values[12]);
     __pyx_v_weight = ((PyArrayObject *)values[13]);
-    __pyx_v_nu = __pyx_PyFloat_AsDouble(values[14]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[15]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_p = __pyx_PyFloat_AsDouble(values[16]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[17]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_probability = __Pyx_PyInt_AsInt(values[18]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nr_class = __Pyx_PyInt_AsInt(values[19]); if (unlikely((__pyx_v_nr_class == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nSV = ((PyArrayObject *)values[20]);
-    __pyx_v_label = ((PyArrayObject *)values[21]);
-    __pyx_v_probA = ((PyArrayObject *)values[22]);
-    __pyx_v_probB = ((PyArrayObject *)values[23]);
-  } else if (PyTuple_GET_SIZE(__pyx_args) != 24) {
+    __pyx_v_nu = __pyx_PyFloat_AsDouble(values[14]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[15]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_p = __pyx_PyFloat_AsDouble(values[16]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[17]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_probability = __Pyx_PyInt_AsInt(values[18]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_nSV = ((PyArrayObject *)values[19]);
+    __pyx_v_label = ((PyArrayObject *)values[20]);
+    __pyx_v_probA = ((PyArrayObject *)values[21]);
+    __pyx_v_probB = ((PyArrayObject *)values[22]);
+  } else if (PyTuple_GET_SIZE(__pyx_args) != 23) {
     goto __pyx_L5_argtuple_error;
   } else {
     __pyx_v_T = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0));
     __pyx_v_SV = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1));
     __pyx_v_sv_coef = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 2));
-    __pyx_v_rho = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 3));
-    __pyx_v_svm_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_kernel_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_degree = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 6)); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_gamma = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 7)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_coef0 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 8)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_eps = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 9)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_C = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 10)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nr_weight = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 11)); if (unlikely((__pyx_v_nr_weight == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_intercept = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 3));
+    __pyx_v_svm_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_kernel_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_degree = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 6)); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_gamma = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 7)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_coef0 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 8)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_eps = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 9)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_C = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 10)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_nr_weight = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 11)); if (unlikely((__pyx_v_nr_weight == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_weight_label = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 12));
     __pyx_v_weight = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 13));
-    __pyx_v_nu = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 14)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 15)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_p = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 16)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_shrinking = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 17)); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_probability = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 18)); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nr_class = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 19)); if (unlikely((__pyx_v_nr_class == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nSV = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 20));
-    __pyx_v_label = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 21));
-    __pyx_v_probA = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 22));
-    __pyx_v_probB = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 23));
+    __pyx_v_nu = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 14)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 15)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_p = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 16)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_shrinking = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 17)); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_probability = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 18)); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_nSV = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 19));
+    __pyx_v_label = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 20));
+    __pyx_v_probA = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 21));
+    __pyx_v_probB = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 22));
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("predict_from_model_wrap", 1, 23, 23, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("libsvm.predict_from_model_wrap");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
+  __Pyx_INCREF((PyObject *)__pyx_v_T);
+  __Pyx_INCREF((PyObject *)__pyx_v_SV);
+  __Pyx_INCREF((PyObject *)__pyx_v_sv_coef);
+  __Pyx_INCREF((PyObject *)__pyx_v_intercept);
+  __Pyx_INCREF((PyObject *)__pyx_v_weight_label);
+  __Pyx_INCREF((PyObject *)__pyx_v_weight);
+  __Pyx_INCREF((PyObject *)__pyx_v_nSV);
+  __Pyx_INCREF((PyObject *)__pyx_v_label);
+  __Pyx_INCREF((PyObject *)__pyx_v_probA);
+  __Pyx_INCREF((PyObject *)__pyx_v_probB);
   __pyx_v_dec_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_bstruct_dec_values.buf = NULL;
   __pyx_bstruct_T.buf = NULL;
   __pyx_bstruct_SV.buf = NULL;
   __pyx_bstruct_sv_coef.buf = NULL;
-  __pyx_bstruct_rho.buf = NULL;
+  __pyx_bstruct_intercept.buf = NULL;
   __pyx_bstruct_weight_label.buf = NULL;
   __pyx_bstruct_weight.buf = NULL;
   __pyx_bstruct_nSV.buf = NULL;
   __pyx_bstruct_label.buf = NULL;
   __pyx_bstruct_probA.buf = NULL;
   __pyx_bstruct_probB.buf = NULL;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T), __pyx_ptype_5numpy_ndarray, 1, "T", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV), __pyx_ptype_5numpy_ndarray, 1, "SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rho), __pyx_ptype_5numpy_ndarray, 1, "rho", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight_label), __pyx_ptype_5numpy_ndarray, 1, "weight_label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight), __pyx_ptype_5numpy_ndarray, 1, "weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T), __pyx_ptype_5numpy_ndarray, 1, "T", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV), __pyx_ptype_5numpy_ndarray, 1, "SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight_label), __pyx_ptype_5numpy_ndarray, 1, "weight_label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight), __pyx_ptype_5numpy_ndarray, 1, "weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_T, (PyObject*)__pyx_v_T, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_T, (PyObject*)__pyx_v_T, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_T = __pyx_bstruct_T.strides[0]; __pyx_bstride_1_T = __pyx_bstruct_T.strides[1];
   __pyx_bshape_0_T = __pyx_bstruct_T.shape[0]; __pyx_bshape_1_T = __pyx_bstruct_T.shape[1];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_SV, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_SV, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_SV = __pyx_bstruct_SV.strides[0]; __pyx_bstride_1_SV = __pyx_bstruct_SV.strides[1];
   __pyx_bshape_0_SV = __pyx_bstruct_SV.shape[0]; __pyx_bshape_1_SV = __pyx_bstruct_SV.shape[1];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sv_coef, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sv_coef, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_sv_coef = __pyx_bstruct_sv_coef.strides[0]; __pyx_bstride_1_sv_coef = __pyx_bstruct_sv_coef.strides[1];
   __pyx_bshape_0_sv_coef = __pyx_bstruct_sv_coef.shape[0]; __pyx_bshape_1_sv_coef = __pyx_bstruct_sv_coef.shape[1];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_rho, (PyObject*)__pyx_v_rho, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_intercept, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_bstride_0_rho = __pyx_bstruct_rho.strides[0];
-  __pyx_bshape_0_rho = __pyx_bstruct_rho.shape[0];
+  __pyx_bstride_0_intercept = __pyx_bstruct_intercept.strides[0];
+  __pyx_bshape_0_intercept = __pyx_bstruct_intercept.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight_label, (PyObject*)__pyx_v_weight_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight_label, (PyObject*)__pyx_v_weight_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_weight_label = __pyx_bstruct_weight_label.strides[0];
   __pyx_bshape_0_weight_label = __pyx_bstruct_weight_label.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight, (PyObject*)__pyx_v_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight, (PyObject*)__pyx_v_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_weight = __pyx_bstruct_weight.strides[0];
   __pyx_bshape_0_weight = __pyx_bstruct_weight.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nSV, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nSV, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_nSV = __pyx_bstruct_nSV.strides[0];
   __pyx_bshape_0_nSV = __pyx_bstruct_nSV.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_label, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_label, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_label = __pyx_bstruct_label.strides[0];
   __pyx_bshape_0_label = __pyx_bstruct_label.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_probA = __pyx_bstruct_probA.strides[0];
   __pyx_bshape_0_probA = __pyx_bstruct_probA.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_probB = __pyx_bstruct_probB.strides[0];
   __pyx_bshape_0_probB = __pyx_bstruct_probB.shape[0];
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":238
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":244
  *                           coef0, nu, cache_size, C, eps, p, shrinking,
  *                           probability, nr_weight, weight_label.data,
  *                           weight.data)             # <<<<<<<<<<<<<<
- *     model = set_model(param, nr_class, SV.data, SV.shape, sv_coef.strides,
- *                       sv_coef.data, rho.data, nSV.data, label.data,
+ * 
+ *     model = set_model(param, nSV.shape[0], SV.data, SV.shape,
  */
   __pyx_v_param = set_parameter(__pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_eps, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, __pyx_v_nr_weight, __pyx_v_weight_label->data, __pyx_v_weight->data);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":241
- *     model = set_model(param, nr_class, SV.data, SV.shape, sv_coef.strides,
- *                       sv_coef.data, rho.data, nSV.data, label.data,
- *                       probA.data, probB.data)             # <<<<<<<<<<<<<<
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":248
+ *     model = set_model(param, nSV.shape[0], SV.data, SV.shape,
+ *                       sv_coef.strides, sv_coef.data, intercept.data,
+ *                       nSV.data, label.data, probA.data, probB.data)             # <<<<<<<<<<<<<<
  *     #TODO: use check_model
  *     dec_values = np.empty(T.shape[0])
  */
-  __pyx_v_model = set_model(__pyx_v_param, __pyx_v_nr_class, __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_rho->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data);
+  __pyx_v_model = set_model(__pyx_v_param, (__pyx_v_nSV->dimensions[0]), __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":243
- *                       probA.data, probB.data)
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":250
+ *                       nSV.data, label.data, probA.data, probB.data)
  *     #TODO: use check_model
  *     dec_values = np.empty(T.shape[0])             # <<<<<<<<<<<<<<
  *     if copy_predict(T.data, model, T.shape, dec_values.data) < 0:
  *         raise MemoryError("We've run out of of memory")
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_1);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_t_2 = PyInt_FromLong((__pyx_v_T->dimensions[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_T->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values);
@@ -2368,14 +2331,14 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
     }
     __pyx_bstride_0_dec_values = __pyx_bstruct_dec_values.strides[0];
     __pyx_bshape_0_dec_values = __pyx_bstruct_dec_values.shape[0];
-    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_t_4 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_v_dec_values));
-  __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_2);
-  __pyx_t_2 = 0;
+  __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":244
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":251
  *     #TODO: use check_model
  *     dec_values = np.empty(T.shape[0])
  *     if copy_predict(T.data, model, T.shape, dec_values.data) < 0:             # <<<<<<<<<<<<<<
@@ -2385,29 +2348,29 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
   __pyx_t_9 = (copy_predict(__pyx_v_T->data, __pyx_v_model, __pyx_v_T->dimensions, __pyx_v_dec_values->data) < 0);
   if (__pyx_t_9) {
 
-    /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":245
+    /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":252
  *     dec_values = np.empty(T.shape[0])
  *     if copy_predict(T.data, model, T.shape, dec_values.data) < 0:
  *         raise MemoryError("We've run out of of memory")             # <<<<<<<<<<<<<<
  *     # free model and param
  *     free_model_SV(model)
  */
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-    __Pyx_INCREF(__pyx_kp_68);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_68);
-    __Pyx_GIVEREF(__pyx_kp_68);
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
+    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_2));
+    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
+    __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L6;
   }
   __pyx_L6:;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":247
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":254
  *         raise MemoryError("We've run out of of memory")
  *     # free model and param
  *     free_model_SV(model)             # <<<<<<<<<<<<<<
@@ -2416,7 +2379,7 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
  */
   free_model_SV(__pyx_v_model);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":248
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":255
  *     # free model and param
  *     free_model_SV(model)
  *     free_model(model)             # <<<<<<<<<<<<<<
@@ -2425,7 +2388,7 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
  */
   free_model(__pyx_v_model);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":249
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":256
  *     free_model_SV(model)
  *     free_model(model)
  *     free_param(param)             # <<<<<<<<<<<<<<
@@ -2434,7 +2397,7 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
  */
   free_param(__pyx_v_param);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":250
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":257
  *     free_model(model)
  *     free_param(param)
  *     return dec_values             # <<<<<<<<<<<<<<
@@ -2449,7 +2412,6 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -2462,8 +2424,8 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sv_coef);
+    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_intercept);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T);
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rho);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nSV);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV);
   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
@@ -2478,18 +2440,28 @@ static PyObject *__pyx_pf_6libsvm_predict_from_model_wrap(PyObject *__pyx_self,
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sv_coef);
+  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_intercept);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T);
-  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rho);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nSV);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV);
   __pyx_L2:;
   __Pyx_DECREF((PyObject *)__pyx_v_dec_values);
+  __Pyx_DECREF((PyObject *)__pyx_v_T);
+  __Pyx_DECREF((PyObject *)__pyx_v_SV);
+  __Pyx_DECREF((PyObject *)__pyx_v_sv_coef);
+  __Pyx_DECREF((PyObject *)__pyx_v_intercept);
+  __Pyx_DECREF((PyObject *)__pyx_v_weight_label);
+  __Pyx_DECREF((PyObject *)__pyx_v_weight);
+  __Pyx_DECREF((PyObject *)__pyx_v_nSV);
+  __Pyx_DECREF((PyObject *)__pyx_v_label);
+  __Pyx_DECREF((PyObject *)__pyx_v_probA);
+  __Pyx_DECREF((PyObject *)__pyx_v_probB);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":253
+/* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":260
  * 
  * 
  * def predict_prob_from_model_wrap(np.ndarray[np.float64_t, ndim=2, mode='c'] T,             # <<<<<<<<<<<<<<
@@ -2503,7 +2475,7 @@ static PyObject *__pyx_pf_6libsvm_predict_prob_from_model_wrap(PyObject *__pyx_s
   PyArrayObject *__pyx_v_T = 0;
   PyArrayObject *__pyx_v_SV = 0;
   PyArrayObject *__pyx_v_sv_coef = 0;
-  PyArrayObject *__pyx_v_rho = 0;
+  PyArrayObject *__pyx_v_intercept = 0;
   int __pyx_v_svm_type;
   int __pyx_v_kernel_type;
   int __pyx_v_degree;
@@ -2519,7 +2491,6 @@ static PyObject *__pyx_pf_6libsvm_predict_prob_from_model_wrap(PyObject *__pyx_s
   double __pyx_v_p;
   int __pyx_v_shrinking;
   int __pyx_v_probability;
-  int __pyx_v_nr_class;
   PyArrayObject *__pyx_v_nSV = 0;
   PyArrayObject *__pyx_v_label = 0;
   PyArrayObject *__pyx_v_probA = 0;
@@ -2553,14 +2524,14 @@ static PyObject *__pyx_pf_6libsvm_predict_prob_from_model_wrap(PyObject *__pyx_s
   Py_ssize_t __pyx_bstride_1_sv_coef = 0;
   Py_ssize_t __pyx_bshape_0_sv_coef = 0;
   Py_ssize_t __pyx_bshape_1_sv_coef = 0;
+  Py_buffer __pyx_bstruct_intercept;
+  Py_ssize_t __pyx_bstride_0_intercept = 0;
+  Py_ssize_t __pyx_bshape_0_intercept = 0;
   Py_buffer __pyx_bstruct_T;
   Py_ssize_t __pyx_bstride_0_T = 0;
   Py_ssize_t __pyx_bstride_1_T = 0;
   Py_ssize_t __pyx_bshape_0_T = 0;
   Py_ssize_t __pyx_bshape_1_T = 0;
-  Py_buffer __pyx_bstruct_rho;
-  Py_ssize_t __pyx_bstride_0_rho = 0;
-  Py_ssize_t __pyx_bshape_0_rho = 0;
   Py_buffer __pyx_bstruct_nSV;
   Py_ssize_t __pyx_bstride_0_nSV = 0;
   Py_ssize_t __pyx_bshape_0_nSV = 0;
@@ -2570,26 +2541,24 @@ static PyObject *__pyx_pf_6libsvm_predict_prob_from_model_wrap(PyObject *__pyx_s
   Py_ssize_t __pyx_bshape_0_SV = 0;
   Py_ssize_t __pyx_bshape_1_SV = 0;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
-  PyObject *__pyx_2 = 0;
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
-  PyArrayObject *__pyx_t_5 = NULL;
-  int __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
+  PyObject *__pyx_t_5 = NULL;
+  PyArrayObject *__pyx_t_6 = NULL;
+  int __pyx_t_7;
   PyObject *__pyx_t_8 = NULL;
   PyObject *__pyx_t_9 = NULL;
-  int __pyx_t_10;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_T,&__pyx_kp_SV,&__pyx_kp_sv_coef,&__pyx_kp_rho,&__pyx_kp_svm_type,&__pyx_kp_kernel_type,&__pyx_kp_degree,&__pyx_kp_gamma,&__pyx_kp_coef0,&__pyx_kp_eps,&__pyx_kp_C,&__pyx_kp_nr_weight,&__pyx_kp_weight_label,&__pyx_kp_weight,&__pyx_kp_nu,&__pyx_kp_cache_size,&__pyx_kp_p,&__pyx_kp_shrinking,&__pyx_kp_probability,&__pyx_kp_nr_class,&__pyx_kp_nSV,&__pyx_kp_label,&__pyx_kp_probA,&__pyx_kp_probB,0};
-  __Pyx_SetupRefcountContext("predict_prob_from_model_wrap");
+  PyObject *__pyx_t_10 = NULL;
+  int __pyx_t_11;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__T,&__pyx_n_s__SV,&__pyx_n_s__sv_coef,&__pyx_n_s__intercept,&__pyx_n_s__svm_type,&__pyx_n_s__kernel_type,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__eps,&__pyx_n_s__C,&__pyx_n_s__nr_weight,&__pyx_n_s__weight_label,&__pyx_n_s__weight,&__pyx_n_s__nu,&__pyx_n_s__cache_size,&__pyx_n_s__p,&__pyx_n_s__shrinking,&__pyx_n_s__probability,&__pyx_n_s__nSV,&__pyx_n_s__label,&__pyx_n_s__probA,&__pyx_n_s__probB,0};
+  __Pyx_RefNannySetupContext("predict_prob_from_model_wrap");
   __pyx_self = __pyx_self;
   if (unlikely(__pyx_kwds)) {
     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
-    PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+    PyObject* values[23] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
     switch (PyTuple_GET_SIZE(__pyx_args)) {
-      case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
       case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
       case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
       case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
@@ -2618,420 +2587,422 @@ static PyObject *__pyx_pf_6libsvm_predict_prob_from_model_wrap(PyObject *__pyx_s
     }
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  0:
-      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_T);
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__T);
       if (likely(values[0])) kw_args--;
       else goto __pyx_L5_argtuple_error;
       case  1:
-      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_SV);
+      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__SV);
       if (likely(values[1])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  2:
-      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_sv_coef);
+      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sv_coef);
       if (likely(values[2])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  3:
-      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_rho);
+      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__intercept);
       if (likely(values[3])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  4:
-      values[4] = PyDict_GetItem(__pyx_kwds, __pyx_kp_svm_type);
+      values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__svm_type);
       if (likely(values[4])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  5:
-      values[5] = PyDict_GetItem(__pyx_kwds, __pyx_kp_kernel_type);
+      values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kernel_type);
       if (likely(values[5])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  6:
-      values[6] = PyDict_GetItem(__pyx_kwds, __pyx_kp_degree);
+      values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__degree);
       if (likely(values[6])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  7:
-      values[7] = PyDict_GetItem(__pyx_kwds, __pyx_kp_gamma);
+      values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gamma);
       if (likely(values[7])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  8:
-      values[8] = PyDict_GetItem(__pyx_kwds, __pyx_kp_coef0);
+      values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coef0);
       if (likely(values[8])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  9:
-      values[9] = PyDict_GetItem(__pyx_kwds, __pyx_kp_eps);
+      values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eps);
       if (likely(values[9])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 10:
-      values[10] = PyDict_GetItem(__pyx_kwds, __pyx_kp_C);
+      values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__C);
       if (likely(values[10])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 11:
-      values[11] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nr_weight);
+      values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nr_weight);
       if (likely(values[11])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 12:
-      values[12] = PyDict_GetItem(__pyx_kwds, __pyx_kp_weight_label);
+      values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weight_label);
       if (likely(values[12])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 13:
-      values[13] = PyDict_GetItem(__pyx_kwds, __pyx_kp_weight);
+      values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__weight);
       if (likely(values[13])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 14:
-      values[14] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nu);
+      values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nu);
       if (likely(values[14])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 15:
-      values[15] = PyDict_GetItem(__pyx_kwds, __pyx_kp_cache_size);
+      values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cache_size);
       if (likely(values[15])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 16:
-      values[16] = PyDict_GetItem(__pyx_kwds, __pyx_kp_p);
+      values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p);
       if (likely(values[16])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 17:
-      values[17] = PyDict_GetItem(__pyx_kwds, __pyx_kp_shrinking);
+      values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shrinking);
       if (likely(values[17])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 18:
-      values[18] = PyDict_GetItem(__pyx_kwds, __pyx_kp_probability);
+      values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probability);
       if (likely(values[18])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 19:
-      values[19] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nr_class);
+      values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nSV);
       if (likely(values[19])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 20:
-      values[20] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nSV);
+      values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__label);
       if (likely(values[20])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 21:
-      values[21] = PyDict_GetItem(__pyx_kwds, __pyx_kp_label);
+      values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probA);
       if (likely(values[21])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case 22:
-      values[22] = PyDict_GetItem(__pyx_kwds, __pyx_kp_probA);
+      values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probB);
       if (likely(values[22])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-      case 23:
-      values[23] = PyDict_GetItem(__pyx_kwds, __pyx_kp_probB);
-      if (likely(values[23])) kw_args--;
-      else {
-        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, 23); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "predict_prob_from_model_wrap") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "predict_prob_from_model_wrap") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_T = ((PyArrayObject *)values[0]);
     __pyx_v_SV = ((PyArrayObject *)values[1]);
     __pyx_v_sv_coef = ((PyArrayObject *)values[2]);
-    __pyx_v_rho = ((PyArrayObject *)values[3]);
-    __pyx_v_svm_type = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_kernel_type = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_degree = __Pyx_PyInt_AsInt(values[6]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[7]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[8]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_eps = __pyx_PyFloat_AsDouble(values[9]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_C = __pyx_PyFloat_AsDouble(values[10]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nr_weight = __Pyx_PyInt_AsInt(values[11]); if (unlikely((__pyx_v_nr_weight == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_intercept = ((PyArrayObject *)values[3]);
+    __pyx_v_svm_type = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_kernel_type = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_degree = __Pyx_PyInt_AsInt(values[6]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[7]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[8]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_eps = __pyx_PyFloat_AsDouble(values[9]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_C = __pyx_PyFloat_AsDouble(values[10]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_nr_weight = __Pyx_PyInt_AsInt(values[11]); if (unlikely((__pyx_v_nr_weight == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_weight_label = ((PyArrayObject *)values[12]);
     __pyx_v_weight = ((PyArrayObject *)values[13]);
-    __pyx_v_nu = __pyx_PyFloat_AsDouble(values[14]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[15]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_p = __pyx_PyFloat_AsDouble(values[16]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[17]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_probability = __Pyx_PyInt_AsInt(values[18]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nr_class = __Pyx_PyInt_AsInt(values[19]); if (unlikely((__pyx_v_nr_class == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nSV = ((PyArrayObject *)values[20]);
-    __pyx_v_label = ((PyArrayObject *)values[21]);
-    __pyx_v_probA = ((PyArrayObject *)values[22]);
-    __pyx_v_probB = ((PyArrayObject *)values[23]);
-  } else if (PyTuple_GET_SIZE(__pyx_args) != 24) {
+    __pyx_v_nu = __pyx_PyFloat_AsDouble(values[14]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[15]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_p = __pyx_PyFloat_AsDouble(values[16]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[17]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_probability = __Pyx_PyInt_AsInt(values[18]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_nSV = ((PyArrayObject *)values[19]);
+    __pyx_v_label = ((PyArrayObject *)values[20]);
+    __pyx_v_probA = ((PyArrayObject *)values[21]);
+    __pyx_v_probB = ((PyArrayObject *)values[22]);
+  } else if (PyTuple_GET_SIZE(__pyx_args) != 23) {
     goto __pyx_L5_argtuple_error;
   } else {
     __pyx_v_T = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0));
     __pyx_v_SV = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1));
     __pyx_v_sv_coef = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 2));
-    __pyx_v_rho = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 3));
-    __pyx_v_svm_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_kernel_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_degree = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 6)); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_gamma = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 7)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_coef0 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 8)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_eps = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 9)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_C = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 10)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nr_weight = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 11)); if (unlikely((__pyx_v_nr_weight == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_intercept = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 3));
+    __pyx_v_svm_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_kernel_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_degree = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 6)); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_gamma = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 7)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_coef0 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 8)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_eps = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 9)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_C = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 10)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_nr_weight = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 11)); if (unlikely((__pyx_v_nr_weight == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_weight_label = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 12));
     __pyx_v_weight = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 13));
-    __pyx_v_nu = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 14)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 15)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_p = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 16)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_shrinking = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 17)); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_probability = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 18)); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nr_class = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 19)); if (unlikely((__pyx_v_nr_class == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_nSV = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 20));
-    __pyx_v_label = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 21));
-    __pyx_v_probA = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 22));
-    __pyx_v_probB = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 23));
+    __pyx_v_nu = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 14)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_cache_size = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 15)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_p = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 16)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_shrinking = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 17)); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_probability = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 18)); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_nSV = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 19));
+    __pyx_v_label = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 20));
+    __pyx_v_probA = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 21));
+    __pyx_v_probB = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 22));
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("predict_prob_from_model_wrap", 1, 23, 23, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("libsvm.predict_prob_from_model_wrap");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
+  __Pyx_INCREF((PyObject *)__pyx_v_T);
+  __Pyx_INCREF((PyObject *)__pyx_v_SV);
+  __Pyx_INCREF((PyObject *)__pyx_v_sv_coef);
+  __Pyx_INCREF((PyObject *)__pyx_v_intercept);
+  __Pyx_INCREF((PyObject *)__pyx_v_weight_label);
+  __Pyx_INCREF((PyObject *)__pyx_v_weight);
+  __Pyx_INCREF((PyObject *)__pyx_v_nSV);
+  __Pyx_INCREF((PyObject *)__pyx_v_label);
+  __Pyx_INCREF((PyObject *)__pyx_v_probA);
+  __Pyx_INCREF((PyObject *)__pyx_v_probB);
   __pyx_v_dec_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
   __pyx_bstruct_dec_values.buf = NULL;
   __pyx_bstruct_T.buf = NULL;
   __pyx_bstruct_SV.buf = NULL;
   __pyx_bstruct_sv_coef.buf = NULL;
-  __pyx_bstruct_rho.buf = NULL;
+  __pyx_bstruct_intercept.buf = NULL;
   __pyx_bstruct_weight_label.buf = NULL;
   __pyx_bstruct_weight.buf = NULL;
   __pyx_bstruct_nSV.buf = NULL;
   __pyx_bstruct_label.buf = NULL;
   __pyx_bstruct_probA.buf = NULL;
   __pyx_bstruct_probB.buf = NULL;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T), __pyx_ptype_5numpy_ndarray, 1, "T", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV), __pyx_ptype_5numpy_ndarray, 1, "SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rho), __pyx_ptype_5numpy_ndarray, 1, "rho", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight_label), __pyx_ptype_5numpy_ndarray, 1, "weight_label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight), __pyx_ptype_5numpy_ndarray, 1, "weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T), __pyx_ptype_5numpy_ndarray, 1, "T", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV), __pyx_ptype_5numpy_ndarray, 1, "SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight_label), __pyx_ptype_5numpy_ndarray, 1, "weight_label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight), __pyx_ptype_5numpy_ndarray, 1, "weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_T, (PyObject*)__pyx_v_T, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_T, (PyObject*)__pyx_v_T, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_T = __pyx_bstruct_T.strides[0]; __pyx_bstride_1_T = __pyx_bstruct_T.strides[1];
   __pyx_bshape_0_T = __pyx_bstruct_T.shape[0]; __pyx_bshape_1_T = __pyx_bstruct_T.shape[1];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_SV, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_SV, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_SV = __pyx_bstruct_SV.strides[0]; __pyx_bstride_1_SV = __pyx_bstruct_SV.strides[1];
   __pyx_bshape_0_SV = __pyx_bstruct_SV.shape[0]; __pyx_bshape_1_SV = __pyx_bstruct_SV.shape[1];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sv_coef, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sv_coef, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_sv_coef = __pyx_bstruct_sv_coef.strides[0]; __pyx_bstride_1_sv_coef = __pyx_bstruct_sv_coef.strides[1];
   __pyx_bshape_0_sv_coef = __pyx_bstruct_sv_coef.shape[0]; __pyx_bshape_1_sv_coef = __pyx_bstruct_sv_coef.shape[1];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_rho, (PyObject*)__pyx_v_rho, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_intercept, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_bstride_0_rho = __pyx_bstruct_rho.strides[0];
-  __pyx_bshape_0_rho = __pyx_bstruct_rho.shape[0];
+  __pyx_bstride_0_intercept = __pyx_bstruct_intercept.strides[0];
+  __pyx_bshape_0_intercept = __pyx_bstruct_intercept.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight_label, (PyObject*)__pyx_v_weight_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight_label, (PyObject*)__pyx_v_weight_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_weight_label = __pyx_bstruct_weight_label.strides[0];
   __pyx_bshape_0_weight_label = __pyx_bstruct_weight_label.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight, (PyObject*)__pyx_v_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_weight, (PyObject*)__pyx_v_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_weight = __pyx_bstruct_weight.strides[0];
   __pyx_bshape_0_weight = __pyx_bstruct_weight.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nSV, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nSV, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_nSV = __pyx_bstruct_nSV.strides[0];
   __pyx_bshape_0_nSV = __pyx_bstruct_nSV.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_label, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_label, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_label = __pyx_bstruct_label.strides[0];
   __pyx_bshape_0_label = __pyx_bstruct_label.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_probA = __pyx_bstruct_probA.strides[0];
   __pyx_bshape_0_probA = __pyx_bstruct_probA.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_bstride_0_probB = __pyx_bstruct_probB.strides[0];
   __pyx_bshape_0_probB = __pyx_bstruct_probB.shape[0];
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":300
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":307
  *                           coef0, nu, cache_size, C, eps, p, shrinking,
  *                           probability, nr_weight, weight_label.data,
  *                           weight.data)             # <<<<<<<<<<<<<<
- *     model = set_model(param, nr_class, SV.data, SV.shape, sv_coef.strides,
- *                       sv_coef.data, rho.data, nSV.data, label.data,
+ *     model = set_model(param, nSV.shape[0], SV.data, SV.shape, sv_coef.strides,
+ *                       sv_coef.data, intercept.data, nSV.data, label.data,
  */
   __pyx_v_param = set_parameter(__pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_eps, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, __pyx_v_nr_weight, __pyx_v_weight_label->data, __pyx_v_weight->data);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":303
- *     model = set_model(param, nr_class, SV.data, SV.shape, sv_coef.strides,
- *                       sv_coef.data, rho.data, nSV.data, label.data,
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":310
+ *     model = set_model(param, nSV.shape[0], SV.data, SV.shape, sv_coef.strides,
+ *                       sv_coef.data, intercept.data, nSV.data, label.data,
  *                       probA.data, probB.data)             # <<<<<<<<<<<<<<
  * 
  *     cdef int nr = get_nr(model)
  */
-  __pyx_v_model = set_model(__pyx_v_param, __pyx_v_nr_class, __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_rho->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data);
+  __pyx_v_model = set_model(__pyx_v_param, (__pyx_v_nSV->dimensions[0]), __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":305
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":312
  *                       probA.data, probB.data)
  * 
  *     cdef int nr = get_nr(model)             # <<<<<<<<<<<<<<
  *     dec_values = np.empty((T.shape[0], nr), dtype=np.float64)
- *     if copy_prob_predict(T.data, model, T.shape, dec_values.data) < 0:
+ *     if copy_predict_proba(T.data, model, T.shape, dec_values.data) < 0:
  */
   __pyx_v_nr = get_nr(__pyx_v_model);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":306
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":313
  * 
  *     cdef int nr = get_nr(model)
  *     dec_values = np.empty((T.shape[0], nr), dtype=np.float64)             # <<<<<<<<<<<<<<
- *     if copy_prob_predict(T.data, model, T.shape, dec_values.data) < 0:
+ *     if copy_predict_proba(T.data, model, T.shape, dec_values.data) < 0:
  *         raise MemoryError("We've run out of of memory")
  */
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_1);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_t_2 = PyInt_FromLong((__pyx_v_T->dimensions[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyInt_FromLong(__pyx_v_nr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_T->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyInt_FromLong(__pyx_v_nr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
   __pyx_t_3 = 0;
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
-  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
   __pyx_t_4 = 0;
-  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_1));
-  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_67); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
-  if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-  if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
+  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values);
-    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
-    if (unlikely(__pyx_t_6 < 0)) {
-      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
+    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
+    if (unlikely(__pyx_t_7 < 0)) {
+      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_v_dec_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
-        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
+        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
         __Pyx_RaiseBufferFallbackError();
       } else {
-        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
+        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
       }
     }
     __pyx_bstride_0_dec_values = __pyx_bstruct_dec_values.strides[0]; __pyx_bstride_1_dec_values = __pyx_bstruct_dec_values.strides[1];
     __pyx_bshape_0_dec_values = __pyx_bstruct_dec_values.shape[0]; __pyx_bshape_1_dec_values = __pyx_bstruct_dec_values.shape[1];
-    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_t_5 = 0;
+  __pyx_t_6 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_v_dec_values));
-  __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_4);
-  __pyx_t_4 = 0;
+  __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5);
+  __pyx_t_5 = 0;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":307
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":314
  *     cdef int nr = get_nr(model)
  *     dec_values = np.empty((T.shape[0], nr), dtype=np.float64)
- *     if copy_prob_predict(T.data, model, T.shape, dec_values.data) < 0:             # <<<<<<<<<<<<<<
+ *     if copy_predict_proba(T.data, model, T.shape, dec_values.data) < 0:             # <<<<<<<<<<<<<<
  *         raise MemoryError("We've run out of of memory")
  *     # free model and param
  */
-  __pyx_t_10 = (copy_prob_predict(__pyx_v_T->data, __pyx_v_model, __pyx_v_T->dimensions, __pyx_v_dec_values->data) < 0);
-  if (__pyx_t_10) {
+  __pyx_t_11 = (copy_predict_proba(__pyx_v_T->data, __pyx_v_model, __pyx_v_T->dimensions, __pyx_v_dec_values->data) < 0);
+  if (__pyx_t_11) {
 
-    /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":308
+    /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":315
  *     dec_values = np.empty((T.shape[0], nr), dtype=np.float64)
- *     if copy_prob_predict(T.data, model, T.shape, dec_values.data) < 0:
+ *     if copy_predict_proba(T.data, model, T.shape, dec_values.data) < 0:
  *         raise MemoryError("We've run out of of memory")             # <<<<<<<<<<<<<<
  *     # free model and param
  *     free_model_SV(model)
  */
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-    __Pyx_INCREF(__pyx_kp_69);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_69);
-    __Pyx_GIVEREF(__pyx_kp_69);
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
+    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_2));
+    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
+    __pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L6;
   }
   __pyx_L6:;
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":310
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":317
  *         raise MemoryError("We've run out of of memory")
  *     # free model and param
  *     free_model_SV(model)             # <<<<<<<<<<<<<<
@@ -3040,7 +3011,7 @@ static PyObject *__pyx_pf_6libsvm_predict_prob_from_model_wrap(PyObject *__pyx_s
  */
   free_model_SV(__pyx_v_model);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":311
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":318
  *     # free model and param
  *     free_model_SV(model)
  *     free_model(model)             # <<<<<<<<<<<<<<
@@ -3049,7 +3020,7 @@ static PyObject *__pyx_pf_6libsvm_predict_prob_from_model_wrap(PyObject *__pyx_s
  */
   free_model(__pyx_v_model);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":312
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":319
  *     free_model_SV(model)
  *     free_model(model)
  *     free_param(param)             # <<<<<<<<<<<<<<
@@ -3057,7 +3028,7 @@ static PyObject *__pyx_pf_6libsvm_predict_prob_from_model_wrap(PyObject *__pyx_s
  */
   free_param(__pyx_v_param);
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":313
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":320
  *     free_model(model)
  *     free_param(param)
  *     return dec_values             # <<<<<<<<<<<<<<
@@ -3070,12 +3041,11 @@ static PyObject *__pyx_pf_6libsvm_predict_prob_from_model_wrap(PyObject *__pyx_s
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
-  __Pyx_XDECREF(__pyx_2);
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_weight);
@@ -3085,8 +3055,8 @@ static PyObject *__pyx_pf_6libsvm_predict_prob_from_model_wrap(PyObject *__pyx_s
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sv_coef);
+    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_intercept);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T);
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rho);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nSV);
     __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV);
   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
@@ -3101,18 +3071,28 @@ static PyObject *__pyx_pf_6libsvm_predict_prob_from_model_wrap(PyObject *__pyx_s
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sv_coef);
+  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_intercept);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T);
-  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rho);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nSV);
   __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV);
   __pyx_L2:;
   __Pyx_DECREF((PyObject *)__pyx_v_dec_values);
+  __Pyx_DECREF((PyObject *)__pyx_v_T);
+  __Pyx_DECREF((PyObject *)__pyx_v_SV);
+  __Pyx_DECREF((PyObject *)__pyx_v_sv_coef);
+  __Pyx_DECREF((PyObject *)__pyx_v_intercept);
+  __Pyx_DECREF((PyObject *)__pyx_v_weight_label);
+  __Pyx_DECREF((PyObject *)__pyx_v_weight);
+  __Pyx_DECREF((PyObject *)__pyx_v_nSV);
+  __Pyx_DECREF((PyObject *)__pyx_v_label);
+  __Pyx_DECREF((PyObject *)__pyx_v_probA);
+  __Pyx_DECREF((PyObject *)__pyx_v_probB);
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":65
+/* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":187
  *         # experimental exception made for __getbuffer__ and __releasebuffer__
  *         # -- the details of this may change.
  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
@@ -3134,18 +3114,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
   int __pyx_v_hasfields;
   int __pyx_r;
   int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
-  int __pyx_t_5;
+  int __pyx_t_2;
+  int __pyx_t_3;
+  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
   int __pyx_t_6;
-  char *__pyx_t_7;
-  __Pyx_SetupRefcountContext("__getbuffer__");
+  int __pyx_t_7;
+  int __pyx_t_8;
+  char *__pyx_t_9;
+  __Pyx_RefNannySetupContext("__getbuffer__");
   if (__pyx_v_info == NULL) return 0;
   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
   __Pyx_GIVEREF(__pyx_v_info->obj);
+  __Pyx_INCREF((PyObject *)__pyx_v_self);
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":71
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":193
  *             # of flags
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -3154,7 +3137,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
   __pyx_v_endian_detector = 1;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":72
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":194
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -3163,7 +3146,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":74
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":196
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  * 
  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
@@ -3172,7 +3155,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
   __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self));
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":76
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":198
  *             ndim = PyArray_NDIM(self)
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
@@ -3182,7 +3165,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
   __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
   if (__pyx_t_1) {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":77
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":199
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 copy_shape = 1             # <<<<<<<<<<<<<<
@@ -3194,7 +3177,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
   }
   /*else*/ {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":79
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":201
  *                 copy_shape = 1
  *             else:
  *                 copy_shape = 0             # <<<<<<<<<<<<<<
@@ -3205,96 +3188,100 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
   }
   __pyx_L5:;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":81
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":203
  *                 copy_shape = 0
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
- *                 raise ValueError("ndarray is not C contiguous")
+ *                 raise ValueError(u"ndarray is not C contiguous")
  */
-  if (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS)) {
+  __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
+  if (__pyx_t_1) {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":82
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":204
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
- *                 raise ValueError("ndarray is not C contiguous")
+ *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  */
-    __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS));
+    __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS));
+    __pyx_t_3 = __pyx_t_2;
   } else {
-    __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
+    __pyx_t_3 = __pyx_t_1;
   }
-  if (__pyx_t_1) {
+  if (__pyx_t_3) {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":83
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":205
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
- *                 raise ValueError("ndarray is not C contiguous")             # <<<<<<<<<<<<<<
+ *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-    __Pyx_INCREF(__pyx_kp_35);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_35);
-    __Pyx_GIVEREF(__pyx_kp_35);
-    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_INCREF(((PyObject *)__pyx_kp_u_3));
+    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_3));
+    __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_3));
+    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_5, 0, 0);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L6;
   }
   __pyx_L6:;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":85
- *                 raise ValueError("ndarray is not C contiguous")
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":207
+ *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
- *                 raise ValueError("ndarray is not Fortran contiguous")
+ *                 raise ValueError(u"ndarray is not Fortran contiguous")
  */
-  if (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS)) {
+  __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
+  if (__pyx_t_3) {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":86
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":208
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
- *                 raise ValueError("ndarray is not Fortran contiguous")
+ *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  */
     __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS));
+    __pyx_t_2 = __pyx_t_1;
   } else {
-    __pyx_t_1 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
+    __pyx_t_2 = __pyx_t_3;
   }
-  if (__pyx_t_1) {
+  if (__pyx_t_2) {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":87
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":209
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
- *                 raise ValueError("ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
+ *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-    __Pyx_INCREF(__pyx_kp_36);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_36);
-    __Pyx_GIVEREF(__pyx_kp_36);
-    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_2, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(((PyObject *)__pyx_kp_u_4));
+    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_4));
+    __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_4));
+    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L7;
   }
   __pyx_L7:;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":89
- *                 raise ValueError("ndarray is not Fortran contiguous")
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":211
+ *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
  *             info.ndim = ndim
@@ -3302,7 +3289,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
   __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self));
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":90
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":212
  * 
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim             # <<<<<<<<<<<<<<
@@ -3311,17 +3298,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
   __pyx_v_info->ndim = __pyx_v_ndim;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":91
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":213
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim
  *             if copy_shape:             # <<<<<<<<<<<<<<
  *                 # Allocate new buffer for strides and shape info. This is allocated
  *                 # as one block, strides first.
  */
-  __pyx_t_4 = __pyx_v_copy_shape;
-  if (__pyx_t_4) {
+  __pyx_t_6 = __pyx_v_copy_shape;
+  if (__pyx_t_6) {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":94
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":216
  *                 # Allocate new buffer for strides and shape info. This is allocated
  *                 # as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)             # <<<<<<<<<<<<<<
@@ -3330,7 +3317,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
     __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2)));
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":95
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":217
  *                 # as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
@@ -3339,17 +3326,18 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":96
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":218
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  */
-    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_v_ndim; __pyx_t_4+=1) {
-      __pyx_v_i = __pyx_t_4;
+    __pyx_t_6 = __pyx_v_ndim;
+    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+      __pyx_v_i = __pyx_t_7;
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":97
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":219
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
@@ -3358,7 +3346,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":98
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":220
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
@@ -3371,7 +3359,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
   }
   /*else*/ {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":100
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":222
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
@@ -3380,7 +3368,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self)));
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":101
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":223
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
@@ -3391,7 +3379,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
   }
   __pyx_L8:;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":102
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":224
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
@@ -3400,7 +3388,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
   __pyx_v_info->suboffsets = NULL;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":103
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":225
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
@@ -3409,7 +3397,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
   __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self));
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":104
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":226
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)
  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
@@ -3418,7 +3406,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
   __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self)));
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":107
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":229
  * 
  *             cdef int t
  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
@@ -3427,7 +3415,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
   __pyx_v_f = NULL;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":108
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":230
  *             cdef int t
  *             cdef char* f = NULL
  *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
@@ -3437,7 +3425,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
   __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr));
   __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":112
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":234
  *             cdef int offset
  * 
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
@@ -3446,21 +3434,23 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
   __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":114
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":236
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
  * 
  *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
  *                 # do not call releasebuffer
  *                 info.obj = None
  */
-  if ((!__pyx_v_hasfields)) {
-    __pyx_t_1 = (!__pyx_v_copy_shape);
+  __pyx_t_2 = (!__pyx_v_hasfields);
+  if (__pyx_t_2) {
+    __pyx_t_3 = (!__pyx_v_copy_shape);
+    __pyx_t_1 = __pyx_t_3;
   } else {
-    __pyx_t_1 = (!__pyx_v_hasfields);
+    __pyx_t_1 = __pyx_t_2;
   }
   if (__pyx_t_1) {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":116
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":238
  *             if not hasfields and not copy_shape:
  *                 # do not call releasebuffer
  *                 info.obj = None             # <<<<<<<<<<<<<<
@@ -3476,7 +3466,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
   }
   /*else*/ {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":119
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":241
  *             else:
  *                 # need to call releasebuffer
  *                 info.obj = self             # <<<<<<<<<<<<<<
@@ -3491,7 +3481,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
   }
   __pyx_L11:;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":121
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":243
  *                 info.obj = self
  * 
  *             if not hasfields:             # <<<<<<<<<<<<<<
@@ -3501,7 +3491,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
   __pyx_t_1 = (!__pyx_v_hasfields);
   if (__pyx_t_1) {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":122
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":244
  * 
  *             if not hasfields:
  *                 t = descr.type_num             # <<<<<<<<<<<<<<
@@ -3510,286 +3500,322 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
     __pyx_v_t = __pyx_v_descr->type_num;
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":123
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":245
  *             if not hasfields:
  *                 t = descr.type_num
  *                 if ((descr.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
  *                     (descr.byteorder == '<' and not little_endian)):
- *                     raise ValueError("Non-native byte order not supported")
+ *                     raise ValueError(u"Non-native byte order not supported")
  */
-    if ((__pyx_v_descr->byteorder == '>')) {
-      __pyx_t_1 = __pyx_v_little_endian;
+    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
+    if (__pyx_t_1) {
+      __pyx_t_2 = __pyx_v_little_endian;
     } else {
-      __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
+      __pyx_t_2 = __pyx_t_1;
     }
-    if (!__pyx_t_1) {
+    if (!__pyx_t_2) {
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":124
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":246
  *                 t = descr.type_num
  *                 if ((descr.byteorder == '>' and little_endian) or
  *                     (descr.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
- *                     raise ValueError("Non-native byte order not supported")
+ *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  */
-      if ((__pyx_v_descr->byteorder == '<')) {
-        __pyx_t_5 = (!__pyx_v_little_endian);
+      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
+      if (__pyx_t_1) {
+        __pyx_t_3 = (!__pyx_v_little_endian);
+        __pyx_t_8 = __pyx_t_3;
       } else {
-        __pyx_t_5 = (__pyx_v_descr->byteorder == '<');
+        __pyx_t_8 = __pyx_t_1;
       }
-      __pyx_t_6 = __pyx_t_5;
+      __pyx_t_1 = __pyx_t_8;
     } else {
-      __pyx_t_6 = __pyx_t_1;
+      __pyx_t_1 = __pyx_t_2;
     }
-    if (__pyx_t_6) {
+    if (__pyx_t_1) {
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":125
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":247
  *                 if ((descr.byteorder == '>' and little_endian) or
  *                     (descr.byteorder == '<' and not little_endian)):
- *                     raise ValueError("Non-native byte order not supported")             # <<<<<<<<<<<<<<
+ *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-      __Pyx_INCREF(__pyx_kp_39);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_39);
-      __Pyx_GIVEREF(__pyx_kp_39);
-      __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-      __Pyx_Raise(__pyx_t_3, 0, 0);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_INCREF(((PyObject *)__pyx_kp_u_5));
+      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_5));
+      __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_5));
+      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_Raise(__pyx_t_5, 0, 0);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L13;
     }
     __pyx_L13:;
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":126
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":248
  *                     (descr.byteorder == '<' and not little_endian)):
- *                     raise ValueError("Non-native byte order not supported")
+ *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  */
-    switch (__pyx_v_t) {
-      case NPY_BYTE:
-      __pyx_v_f = __pyx_k_40;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__b;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":127
- *                     raise ValueError("Non-native byte order not supported")
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":249
+ *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  */
-      case NPY_UBYTE:
-      __pyx_v_f = __pyx_k_41;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__B;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":128
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":250
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  */
-      case NPY_SHORT:
-      __pyx_v_f = __pyx_k_42;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__h;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":129
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":251
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  */
-      case NPY_USHORT:
-      __pyx_v_f = __pyx_k_43;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__H;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":130
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":252
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  */
-      case NPY_INT:
-      __pyx_v_f = __pyx_k_44;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_INT);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__i;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":131
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":253
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  */
-      case NPY_UINT:
-      __pyx_v_f = __pyx_k_45;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__I;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":132
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":254
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  */
-      case NPY_LONG:
-      __pyx_v_f = __pyx_k_46;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__l;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":133
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":255
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  */
-      case NPY_ULONG:
-      __pyx_v_f = __pyx_k_47;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__L;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":134
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":256
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  */
-      case NPY_LONGLONG:
-      __pyx_v_f = __pyx_k_48;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__q;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":135
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":257
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  */
-      case NPY_ULONGLONG:
-      __pyx_v_f = __pyx_k_49;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__Q;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":136
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":258
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  */
-      case NPY_FLOAT:
-      __pyx_v_f = __pyx_k_50;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__f;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":137
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":259
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  */
-      case NPY_DOUBLE:
-      __pyx_v_f = __pyx_k_51;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__d;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":138
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":260
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  */
-      case NPY_LONGDOUBLE:
-      __pyx_v_f = __pyx_k_52;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__g;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":139
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":261
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  */
-      case NPY_CFLOAT:
-      __pyx_v_f = __pyx_k_53;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__Zf;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":140
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":262
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"
  */
-      case NPY_CDOUBLE:
-      __pyx_v_f = __pyx_k_54;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__Zd;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":141
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":263
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  */
-      case NPY_CLONGDOUBLE:
-      __pyx_v_f = __pyx_k_55;
-      break;
+    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__Zg;
+      goto __pyx_L14;
+    }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":142
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":264
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
  *                 else:
- *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
+ *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-      case NPY_OBJECT:
-      __pyx_v_f = __pyx_k_56;
-      break;
-      default:
+    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
+    if (__pyx_t_1) {
+      __pyx_v_f = __pyx_k__O;
+      goto __pyx_L14;
+    }
+    /*else*/ {
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":144
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":266
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
- *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
+ *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *                 info.format = f
  *                 return
  */
-      __pyx_t_3 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_2 = PyNumber_Remainder(__pyx_kp_57, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-      __Pyx_Raise(__pyx_t_2, 0, 0);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      break;
+      __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_6), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+      __Pyx_GIVEREF(__pyx_t_4);
+      __pyx_t_4 = 0;
+      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_Raise(__pyx_t_4, 0, 0);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
+    __pyx_L14:;
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":145
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":267
  *                 else:
- *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
+ *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f             # <<<<<<<<<<<<<<
  *                 return
  *             else:
  */
     __pyx_v_info->format = __pyx_v_f;
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":146
- *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":268
+ *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f
  *                 return             # <<<<<<<<<<<<<<
  *             else:
@@ -3801,7 +3827,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
   }
   /*else*/ {
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":148
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":270
  *                 return
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
@@ -3810,7 +3836,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
     __pyx_v_info->format = ((char *)malloc(255));
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":149
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":271
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = '^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
@@ -3819,7 +3845,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
     (__pyx_v_info->format[0]) = '^';
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":150
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":272
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  *                 info.format[0] = '^' # Native data types, manual alignment
  *                 offset = 0             # <<<<<<<<<<<<<<
@@ -3828,111 +3854,308 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf
  */
     __pyx_v_offset = 0;
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":153
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":275
  *                 f = _util_dtypestring(descr, info.format + 1,
  *                                       info.format + _buffer_format_string_len,
  *                                       &offset)             # <<<<<<<<<<<<<<
  *                 f[0] = 0 # Terminate format string
  * 
  */
-    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_f = __pyx_t_7;
+    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_f = __pyx_t_9;
+
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":276
+ *                                       info.format + _buffer_format_string_len,
+ *                                       &offset)
+ *                 f[0] = 0 # Terminate format string             # <<<<<<<<<<<<<<
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):
+ */
+    (__pyx_v_f[0]) = 0;
+  }
+  __pyx_L12:;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__");
+  __pyx_r = -1;
+  __Pyx_GOTREF(__pyx_v_info->obj);
+  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
+  goto __pyx_L2;
+  __pyx_L0:;
+  if (__pyx_v_info->obj == Py_None) {
+    __Pyx_GOTREF(Py_None);
+    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+  }
+  __pyx_L2:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
+  __Pyx_DECREF((PyObject *)__pyx_v_self);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":278
+ *                 f[0] = 0 # Terminate format string
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ */
+
+static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
+static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
+  int __pyx_t_1;
+  __Pyx_RefNannySetupContext("__releasebuffer__");
+  __Pyx_INCREF((PyObject *)__pyx_v_self);
+
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":279
+ * 
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):
+ *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
+ *                 stdlib.free(info.format)
+ *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+  __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self));
+  if (__pyx_t_1) {
+
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":280
+ *         def __releasebuffer__(ndarray self, Py_buffer* info):
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
+ *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ *                 stdlib.free(info.strides)
+ */
+    free(__pyx_v_info->format);
+    goto __pyx_L5;
+  }
+  __pyx_L5:;
+
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":281
+ *             if PyArray_HASFIELDS(self):
+ *                 stdlib.free(info.format)
+ *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
+ *                 stdlib.free(info.strides)
+ *                 # info.shape was stored after info.strides in the same block
+ */
+  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+  if (__pyx_t_1) {
+
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":282
+ *                 stdlib.free(info.format)
+ *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
+ *                 # info.shape was stored after info.strides in the same block
+ * 
+ */
+    free(__pyx_v_info->strides);
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  __Pyx_DECREF((PyObject *)__pyx_v_self);
+  __Pyx_RefNannyFinishContext();
+}
+
+/* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":755
+ * ctypedef npy_cdouble     complex_t
+ * 
+ * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ */
+
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_t_1 = NULL;
+  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1");
+
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":756
+ * 
+ * cdef inline object PyArray_MultiIterNew1(a):
+ *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
+ * 
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1");
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":758
+ *     return PyArray_MultiIterNew(1, <void*>a)
+ * 
+ * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ */
+
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_t_1 = NULL;
+  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2");
+
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":759
+ * 
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
+ * 
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2");
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":761
+ *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ * 
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ */
+
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_t_1 = NULL;
+  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3");
+
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":762
+ * 
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
+ * 
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3");
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":764
+ *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ * 
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ * 
+ */
+
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_t_1 = NULL;
+  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4");
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":154
- *                                       info.format + _buffer_format_string_len,
- *                                       &offset)
- *                 f[0] = 0 # Terminate format string             # <<<<<<<<<<<<<<
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":765
  * 
- *         def __releasebuffer__(ndarray self, Py_buffer* info):
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
+ * 
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  */
-    (__pyx_v_f[0]) = 0;
-  }
-  __pyx_L12:;
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
 
-  __pyx_r = 0;
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__");
-  __pyx_r = -1;
-  __Pyx_GOTREF(__pyx_v_info->obj);
-  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
-  goto __pyx_L2;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4");
+  __pyx_r = 0;
   __pyx_L0:;
-  if (__pyx_v_info->obj == Py_None) {
-    __Pyx_GOTREF(Py_None);
-    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
-  }
-  __pyx_L2:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
-  __Pyx_FinishRefcountContext();
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":156
- *                 f[0] = 0 # Terminate format string
+/* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":767
+ *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  * 
- *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
- *             if PyArray_HASFIELDS(self):
- *                 stdlib.free(info.format)
- */
-
-static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
-static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
-  int __pyx_t_1;
-  int __pyx_t_2;
-  __Pyx_SetupRefcountContext("__releasebuffer__");
-
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":157
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  * 
- *         def __releasebuffer__(ndarray self, Py_buffer* info):
- *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
- *                 stdlib.free(info.format)
- *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
- */
-  __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self));
-  if (__pyx_t_1) {
-
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":158
- *         def __releasebuffer__(ndarray self, Py_buffer* info):
- *             if PyArray_HASFIELDS(self):
- *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
- *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
- *                 stdlib.free(info.strides)
  */
-    free(__pyx_v_info->format);
-    goto __pyx_L5;
-  }
-  __pyx_L5:;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":159
- *             if PyArray_HASFIELDS(self):
- *                 stdlib.free(info.format)
- *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
- *                 stdlib.free(info.strides)
- *                 # info.shape was stored after info.strides in the same block
- */
-  __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
-  if (__pyx_t_2) {
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_t_1 = NULL;
+  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5");
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":160
- *                 stdlib.free(info.format)
- *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
- *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
- *                 # info.shape was stored after info.strides in the same block
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":768
  * 
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
+ * 
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
  */
-    free(__pyx_v_info->strides);
-    goto __pyx_L6;
-  }
-  __pyx_L6:;
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
 
-  __Pyx_FinishRefcountContext();
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5");
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
 }
 
-/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":277
- * ctypedef npy_cdouble     complex_t
+/* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":770
+ *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  * 
  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
  *     # Recursive utility function used in __getbuffer__ to get format
@@ -3941,13 +4164,13 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P
 
 static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
   PyArray_Descr *__pyx_v_child;
-  PyObject *__pyx_v_i;
   int __pyx_v_endian_detector;
   int __pyx_v_little_endian;
+  PyObject *__pyx_v_fields;
+  PyObject *__pyx_v_childname;
   PyObject *__pyx_v_new_offset;
   PyObject *__pyx_v_t;
   char *__pyx_r;
-  PyObject *__pyx_1 = 0;
   Py_ssize_t __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
@@ -3956,199 +4179,195 @@ static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_desc
   int __pyx_t_6;
   int __pyx_t_7;
   int __pyx_t_8;
-  char *__pyx_t_9;
-  __Pyx_SetupRefcountContext("_util_dtypestring");
+  int __pyx_t_9;
+  char *__pyx_t_10;
+  __Pyx_RefNannySetupContext("_util_dtypestring");
+  __Pyx_INCREF((PyObject *)__pyx_v_descr);
   __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None);
-  __pyx_v_i = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
+  __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
+  __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None);
   __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None);
   __pyx_v_t = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":284
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":777
  *     cdef int delta_offset
  *     cdef tuple i
  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
- * 
+ *     cdef tuple fields
  */
   __pyx_v_endian_detector = 1;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":285
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":778
  *     cdef tuple i
  *     cdef int endian_detector = 1
  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
+ *     cdef tuple fields
  * 
- *     for i in descr.fields.itervalues():
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":287
- *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":781
+ *     cdef tuple fields
  * 
- *     for i in descr.fields.itervalues():             # <<<<<<<<<<<<<<
- *         child = i[0]
- *         new_offset = i[1]
+ *     for childname in descr.names:             # <<<<<<<<<<<<<<
+ *         fields = descr.fields[childname]
+ *         child, new_offset = fields
  */
-  __pyx_t_2 = PyObject_GetAttr(__pyx_v_descr->fields, __pyx_kp_itervalues); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
-    __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
+  if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) {
+    __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2);
   } else {
-    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   for (;;) {
-    if (likely(PyList_CheckExact(__pyx_t_2))) {
-      if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
-    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
-      if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
-    } else {
-      __pyx_t_3 = PyIter_Next(__pyx_t_2);
-      if (!__pyx_t_3) {
-        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_3);
-    }
-    if (!(likely(PyTuple_CheckExact(__pyx_t_3)) || (__pyx_t_3) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(((PyObject *)__pyx_v_i));
-    __pyx_v_i = ((PyObject *)__pyx_t_3);
+    if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
+    __Pyx_DECREF(__pyx_v_childname);
+    __pyx_v_childname = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":288
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":782
  * 
- *     for i in descr.fields.itervalues():
- *         child = i[0]             # <<<<<<<<<<<<<<
- *         new_offset = i[1]
+ *     for childname in descr.names:
+ *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
+ *         child, new_offset = fields
  * 
  */
-    __pyx_1 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_i), 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_5numpy_dtype))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(((PyObject *)__pyx_v_child));
-    __pyx_v_child = ((PyArray_Descr *)__pyx_1);
-    __pyx_1 = 0;
+    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(((PyObject *)__pyx_v_fields));
+    __pyx_v_fields = ((PyObject *)__pyx_t_3);
+    __pyx_t_3 = 0;
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":289
- *     for i in descr.fields.itervalues():
- *         child = i[0]
- *         new_offset = i[1]             # <<<<<<<<<<<<<<
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":783
+ *     for childname in descr.names:
+ *         fields = descr.fields[childname]
+ *         child, new_offset = fields             # <<<<<<<<<<<<<<
  * 
  *         if (end - f) - (new_offset - offset[0]) < 15:
  */
-    __pyx_1 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_i), 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    __Pyx_DECREF(__pyx_v_new_offset);
-    __pyx_v_new_offset = __pyx_1;
-    __pyx_1 = 0;
+    if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) {
+      PyObject* tuple = ((PyObject *)__pyx_v_fields);
+      __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3);
+      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4);
+      __Pyx_DECREF(((PyObject *)__pyx_v_child));
+      __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
+      __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_v_new_offset);
+      __pyx_v_new_offset = __pyx_t_4;
+      __pyx_t_4 = 0;
+    } else {
+      __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2);
+      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":291
- *         new_offset = i[1]
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":785
+ *         child, new_offset = fields
  * 
  *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
- *             raise RuntimeError("Format string allocated too short, see comment in numpy.pxd")
+ *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  */
-    __pyx_t_3 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     if (__pyx_t_6) {
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":292
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":786
  * 
  *         if (end - f) - (new_offset - offset[0]) < 15:
- *             raise RuntimeError("Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
+ *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
  *         if ((child.byteorder == '>' and little_endian) or
  */
-      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-      __Pyx_INCREF(__pyx_kp_59);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_59);
-      __Pyx_GIVEREF(__pyx_kp_59);
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-      __Pyx_Raise(__pyx_t_4, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_INCREF(((PyObject *)__pyx_kp_u_7));
+      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_7));
+      __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_7));
+      __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_Raise(__pyx_t_3, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L5;
     }
     __pyx_L5:;
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":294
- *             raise RuntimeError("Format string allocated too short, see comment in numpy.pxd")
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":788
+ *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  *         if ((child.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
  *             (child.byteorder == '<' and not little_endian)):
- *             raise ValueError("Non-native byte order not supported")
+ *             raise ValueError(u"Non-native byte order not supported")
  */
-    if ((__pyx_v_child->byteorder == '>')) {
-      __pyx_t_6 = __pyx_v_little_endian;
+    __pyx_t_6 = (__pyx_v_child->byteorder == '>');
+    if (__pyx_t_6) {
+      __pyx_t_7 = __pyx_v_little_endian;
     } else {
-      __pyx_t_6 = (__pyx_v_child->byteorder == '>');
+      __pyx_t_7 = __pyx_t_6;
     }
-    if (!__pyx_t_6) {
+    if (!__pyx_t_7) {
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":295
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":789
  * 
  *         if ((child.byteorder == '>' and little_endian) or
  *             (child.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
- *             raise ValueError("Non-native byte order not supported")
+ *             raise ValueError(u"Non-native byte order not supported")
  *             # One could encode it in the format string and have Cython
  */
-      if ((__pyx_v_child->byteorder == '<')) {
-        __pyx_t_7 = (!__pyx_v_little_endian);
+      __pyx_t_6 = (__pyx_v_child->byteorder == '<');
+      if (__pyx_t_6) {
+        __pyx_t_8 = (!__pyx_v_little_endian);
+        __pyx_t_9 = __pyx_t_8;
       } else {
-        __pyx_t_7 = (__pyx_v_child->byteorder == '<');
+        __pyx_t_9 = __pyx_t_6;
       }
-      __pyx_t_8 = __pyx_t_7;
+      __pyx_t_6 = __pyx_t_9;
     } else {
-      __pyx_t_8 = __pyx_t_6;
+      __pyx_t_6 = __pyx_t_7;
     }
-    if (__pyx_t_8) {
+    if (__pyx_t_6) {
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":296
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":790
  *         if ((child.byteorder == '>' and little_endian) or
  *             (child.byteorder == '<' and not little_endian)):
- *             raise ValueError("Non-native byte order not supported")             # <<<<<<<<<<<<<<
+ *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-      __Pyx_INCREF(__pyx_kp_62);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_62);
-      __Pyx_GIVEREF(__pyx_kp_62);
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_INCREF(((PyObject *)__pyx_kp_u_5));
+      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_5));
+      __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_5));
+      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_Raise(__pyx_t_5, 0, 0);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       goto __pyx_L6;
     }
     __pyx_L6:;
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":306
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":800
  * 
  *         # Output padding bytes
  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
@@ -4156,16 +4375,16 @@ static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_desc
  *             f += 1
  */
     while (1) {
-      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (!__pyx_t_8) break;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (!__pyx_t_6) break;
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":307
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":801
  *         # Output padding bytes
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
@@ -4174,7 +4393,7 @@ static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_desc
  */
       (__pyx_v_f[0]) = 120;
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":308
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":802
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte
  *             f += 1             # <<<<<<<<<<<<<<
@@ -4183,7 +4402,7 @@ static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_desc
  */
       __pyx_v_f += 1;
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":309
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":803
  *             f[0] = 120 # "x"; pad byte
  *             f += 1
  *             offset[0] += 1             # <<<<<<<<<<<<<<
@@ -4193,7 +4412,7 @@ static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_desc
       (__pyx_v_offset[0]) += 1;
     }
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":311
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":805
  *             offset[0] += 1
  * 
  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
@@ -4202,417 +4421,417 @@ static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_desc
  */
     (__pyx_v_offset[0]) += __pyx_v_child->elsize;
 
-    /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":313
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":807
  *         offset[0] += child.itemsize
  * 
  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
  *             t = child.type_num
  *             if end - f < 5:
  */
-    __pyx_t_8 = (!PyDataType_HASFIELDS(__pyx_v_child));
-    if (__pyx_t_8) {
+    __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child));
+    if (__pyx_t_6) {
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":314
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":808
  * 
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num             # <<<<<<<<<<<<<<
  *             if end - f < 5:
- *                 raise RuntimeError("Format string allocated too short.")
+ *                 raise RuntimeError(u"Format string allocated too short.")
  */
-      __pyx_t_4 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_v_t);
-      __pyx_v_t = __pyx_t_4;
-      __pyx_t_4 = 0;
+      __pyx_v_t = __pyx_t_3;
+      __pyx_t_3 = 0;
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":315
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":809
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num
  *             if end - f < 5:             # <<<<<<<<<<<<<<
- *                 raise RuntimeError("Format string allocated too short.")
+ *                 raise RuntimeError(u"Format string allocated too short.")
  * 
  */
-      __pyx_t_8 = ((__pyx_v_end - __pyx_v_f) < 5);
-      if (__pyx_t_8) {
+      __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5);
+      if (__pyx_t_6) {
 
-        /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":316
+        /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":810
  *             t = child.type_num
  *             if end - f < 5:
- *                 raise RuntimeError("Format string allocated too short.")             # <<<<<<<<<<<<<<
+ *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-        __Pyx_INCREF(__pyx_kp_63);
-        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_63);
-        __Pyx_GIVEREF(__pyx_kp_63);
-        __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_INCREF(((PyObject *)__pyx_kp_u_8));
+        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_8));
+        __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_8));
+        __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_Raise(__pyx_t_5, 0, 0);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         goto __pyx_L10;
       }
       __pyx_L10:;
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":319
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":813
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_8) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 98;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":320
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":814
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  */
-      __pyx_t_4 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_8) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 66;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":321
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":815
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_8) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 104;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":322
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":816
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  */
-      __pyx_t_4 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_8) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 72;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":323
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":817
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_8) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 105;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":324
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":818
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  */
-      __pyx_t_4 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_8) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 73;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":325
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":819
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_8) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 108;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":326
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":820
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  */
-      __pyx_t_4 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_8) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 76;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":327
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":821
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_8) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 113;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":328
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":822
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  */
-      __pyx_t_4 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_8) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 81;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":329
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":823
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_8) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 102;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":330
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":824
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  */
-      __pyx_t_4 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_8) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 100;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":331
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":825
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_8) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 103;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":332
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":826
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  */
-      __pyx_t_4 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_8) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 102;
         __pyx_v_f += 1;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":333
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":827
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_8) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 100;
         __pyx_v_f += 1;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":334
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":828
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  */
-      __pyx_t_4 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_8) {
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 103;
         __pyx_v_f += 1;
         goto __pyx_L11;
       }
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":335
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":829
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
  *             else:
- *                 raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
+ *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (__pyx_t_8) {
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_6) {
         (__pyx_v_f[0]) = 79;
         goto __pyx_L11;
       }
       /*else*/ {
 
-        /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":337
+        /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":831
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
- *                 raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
+ *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *             f += 1
  *         else:
  */
-        __pyx_t_4 = PyNumber_Remainder(__pyx_kp_64, __pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
-        __Pyx_GIVEREF(__pyx_t_4);
-        __pyx_t_4 = 0;
-        __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-        __Pyx_Raise(__pyx_t_4, 0, 0);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_6), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_5);
+        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_Raise(__pyx_t_3, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       __pyx_L11:;
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":338
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":832
  *             else:
- *                 raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
+ *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *             f += 1             # <<<<<<<<<<<<<<
  *         else:
  *             # Cython ignores struct boundary information ("T{...}"),
@@ -4622,25 +4841,26 @@ static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_desc
     }
     /*else*/ {
 
-      /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":342
+      /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":836
  *             # Cython ignores struct boundary information ("T{...}"),
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
  *     return f
  * 
  */
-      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_f = __pyx_t_9;
+      __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_f = __pyx_t_10;
     }
     __pyx_L9:;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":343
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":837
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)
  *     return f             # <<<<<<<<<<<<<<
  * 
+ * 
  */
   __pyx_r = __pyx_v_f;
   goto __pyx_L0;
@@ -4648,7 +4868,6 @@ static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_desc
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
@@ -4656,11 +4875,152 @@ static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_desc
   __Pyx_AddTraceback("numpy._util_dtypestring");
   __pyx_r = NULL;
   __pyx_L0:;
-  __Pyx_DECREF((PyObject *)__pyx_v_child);
-  __Pyx_DECREF(__pyx_v_i);
-  __Pyx_DECREF(__pyx_v_new_offset);
-  __Pyx_DECREF(__pyx_v_t);
-  __Pyx_FinishRefcountContext();
+  __Pyx_DECREF((PyObject *)__pyx_v_child);
+  __Pyx_DECREF(__pyx_v_fields);
+  __Pyx_DECREF(__pyx_v_childname);
+  __Pyx_DECREF(__pyx_v_new_offset);
+  __Pyx_DECREF(__pyx_v_t);
+  __Pyx_DECREF((PyObject *)__pyx_v_descr);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":952
+ * 
+ * 
+ * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
+ *      cdef PyObject* baseptr
+ *      if base is None:
+ */
+
+static INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
+  PyObject *__pyx_v_baseptr;
+  int __pyx_t_1;
+  __Pyx_RefNannySetupContext("set_array_base");
+  __Pyx_INCREF((PyObject *)__pyx_v_arr);
+  __Pyx_INCREF(__pyx_v_base);
+
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":954
+ * cdef inline void set_array_base(ndarray arr, object base):
+ *      cdef PyObject* baseptr
+ *      if base is None:             # <<<<<<<<<<<<<<
+ *          baseptr = NULL
+ *      else:
+ */
+  __pyx_t_1 = (__pyx_v_base == Py_None);
+  if (__pyx_t_1) {
+
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":955
+ *      cdef PyObject* baseptr
+ *      if base is None:
+ *          baseptr = NULL             # <<<<<<<<<<<<<<
+ *      else:
+ *          Py_INCREF(base) # important to do this before decref below!
+ */
+    __pyx_v_baseptr = NULL;
+    goto __pyx_L3;
+  }
+  /*else*/ {
+
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":957
+ *          baseptr = NULL
+ *      else:
+ *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
+ *          baseptr = <PyObject*>base
+ *      Py_XDECREF(arr.base)
+ */
+    Py_INCREF(__pyx_v_base);
+
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":958
+ *      else:
+ *          Py_INCREF(base) # important to do this before decref below!
+ *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
+ *      Py_XDECREF(arr.base)
+ *      arr.base = baseptr
+ */
+    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
+  }
+  __pyx_L3:;
+
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":959
+ *          Py_INCREF(base) # important to do this before decref below!
+ *          baseptr = <PyObject*>base
+ *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
+ *      arr.base = baseptr
+ * 
+ */
+  Py_XDECREF(__pyx_v_arr->base);
+
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":960
+ *          baseptr = <PyObject*>base
+ *      Py_XDECREF(arr.base)
+ *      arr.base = baseptr             # <<<<<<<<<<<<<<
+ * 
+ * cdef inline object get_array_base(ndarray arr):
+ */
+  __pyx_v_arr->base = __pyx_v_baseptr;
+
+  __Pyx_DECREF((PyObject *)__pyx_v_arr);
+  __Pyx_DECREF(__pyx_v_base);
+  __Pyx_RefNannyFinishContext();
+}
+
+/* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":962
+ *      arr.base = baseptr
+ * 
+ * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
+ *     if arr.base is NULL:
+ *         return None
+ */
+
+static INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
+  PyObject *__pyx_r = NULL;
+  int __pyx_t_1;
+  __Pyx_RefNannySetupContext("get_array_base");
+  __Pyx_INCREF((PyObject *)__pyx_v_arr);
+
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":963
+ * 
+ * cdef inline object get_array_base(ndarray arr):
+ *     if arr.base is NULL:             # <<<<<<<<<<<<<<
+ *         return None
+ *     else:
+ */
+  __pyx_t_1 = (__pyx_v_arr->base == NULL);
+  if (__pyx_t_1) {
+
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":964
+ * cdef inline object get_array_base(ndarray arr):
+ *     if arr.base is NULL:
+ *         return None             # <<<<<<<<<<<<<<
+ *     else:
+ *         return <object>arr.base
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(Py_None);
+    __pyx_r = Py_None;
+    goto __pyx_L0;
+    goto __pyx_L3;
+  }
+  /*else*/ {
+
+    /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":966
+ *         return None
+ *     else:
+ *         return <object>arr.base             # <<<<<<<<<<<<<<
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
+    __pyx_r = ((PyObject *)__pyx_v_arr->base);
+    goto __pyx_L0;
+  }
+  __pyx_L3:;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __pyx_L0:;
+  __Pyx_DECREF((PyObject *)__pyx_v_arr);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
@@ -4677,7 +5037,7 @@ static void __pyx_init_filenames(void); /*proto*/
 static struct PyModuleDef __pyx_moduledef = {
     PyModuleDef_HEAD_INIT,
     __Pyx_NAMESTR("libsvm"),
-    __Pyx_DOCSTR(__pyx_mdoc), /* m_doc */
+    __Pyx_DOCSTR(__pyx_k_9), /* m_doc */
     -1, /* m_size */
     __pyx_methods /* m_methods */,
     NULL, /* m_reload */
@@ -4688,75 +5048,92 @@ static struct PyModuleDef __pyx_moduledef = {
 #endif
 
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp___main__, __pyx_k___main__, sizeof(__pyx_k___main__), 1, 1, 1},
-  {&__pyx_kp_X, __pyx_k_X, sizeof(__pyx_k_X), 1, 1, 1},
-  {&__pyx_kp_Y, __pyx_k_Y, sizeof(__pyx_k_Y), 1, 1, 1},
-  {&__pyx_kp_svm_type, __pyx_k_svm_type, sizeof(__pyx_k_svm_type), 1, 1, 1},
-  {&__pyx_kp_kernel_type, __pyx_k_kernel_type, sizeof(__pyx_k_kernel_type), 1, 1, 1},
-  {&__pyx_kp_degree, __pyx_k_degree, sizeof(__pyx_k_degree), 1, 1, 1},
-  {&__pyx_kp_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 1, 1, 1},
-  {&__pyx_kp_coef0, __pyx_k_coef0, sizeof(__pyx_k_coef0), 1, 1, 1},
-  {&__pyx_kp_eps, __pyx_k_eps, sizeof(__pyx_k_eps), 1, 1, 1},
-  {&__pyx_kp_C, __pyx_k_C, sizeof(__pyx_k_C), 1, 1, 1},
-  {&__pyx_kp_nr_weight, __pyx_k_nr_weight, sizeof(__pyx_k_nr_weight), 1, 1, 1},
-  {&__pyx_kp_weight_label, __pyx_k_weight_label, sizeof(__pyx_k_weight_label), 1, 1, 1},
-  {&__pyx_kp_weight, __pyx_k_weight, sizeof(__pyx_k_weight), 1, 1, 1},
-  {&__pyx_kp_nu, __pyx_k_nu, sizeof(__pyx_k_nu), 1, 1, 1},
-  {&__pyx_kp_cache_size, __pyx_k_cache_size, sizeof(__pyx_k_cache_size), 1, 1, 1},
-  {&__pyx_kp_p, __pyx_k_p, sizeof(__pyx_k_p), 1, 1, 1},
-  {&__pyx_kp_shrinking, __pyx_k_shrinking, sizeof(__pyx_k_shrinking), 1, 1, 1},
-  {&__pyx_kp_probability, __pyx_k_probability, sizeof(__pyx_k_probability), 1, 1, 1},
-  {&__pyx_kp_T, __pyx_k_T, sizeof(__pyx_k_T), 1, 1, 1},
-  {&__pyx_kp_SV, __pyx_k_SV, sizeof(__pyx_k_SV), 1, 1, 1},
-  {&__pyx_kp_sv_coef, __pyx_k_sv_coef, sizeof(__pyx_k_sv_coef), 1, 1, 1},
-  {&__pyx_kp_rho, __pyx_k_rho, sizeof(__pyx_k_rho), 1, 1, 1},
-  {&__pyx_kp_nr_class, __pyx_k_nr_class, sizeof(__pyx_k_nr_class), 1, 1, 1},
-  {&__pyx_kp_nSV, __pyx_k_nSV, sizeof(__pyx_k_nSV), 1, 1, 1},
-  {&__pyx_kp_label, __pyx_k_label, sizeof(__pyx_k_label), 1, 1, 1},
-  {&__pyx_kp_probA, __pyx_k_probA, sizeof(__pyx_k_probA), 1, 1, 1},
-  {&__pyx_kp_probB, __pyx_k_probB, sizeof(__pyx_k_probB), 1, 1, 1},
-  {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1},
-  {&__pyx_kp_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1},
-  {&__pyx_kp_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 1, 1, 1},
-  {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1},
-  {&__pyx_kp_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 1, 1, 1},
-  {&__pyx_kp_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 1, 1, 1},
-  {&__pyx_kp_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 1, 1, 1},
-  {&__pyx_kp_66, __pyx_k_66, sizeof(__pyx_k_66), 1, 1, 1},
-  {&__pyx_kp_67, __pyx_k_67, sizeof(__pyx_k_67), 1, 1, 1},
-  {&__pyx_kp_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 0},
-  {&__pyx_kp_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 0},
-  {&__pyx_kp_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 0},
-  {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 1, 1, 1},
-  {&__pyx_kp___releasebuffer__, __pyx_k___releasebuffer__, sizeof(__pyx_k___releasebuffer__), 1, 1, 1},
-  {&__pyx_kp_info, __pyx_k_info, sizeof(__pyx_k_info), 1, 1, 1},
-  {&__pyx_kp_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 1, 1, 1},
-  {&__pyx_kp_range, __pyx_k_range, sizeof(__pyx_k_range), 1, 1, 1},
-  {&__pyx_kp_itervalues, __pyx_k_itervalues, sizeof(__pyx_k_itervalues), 1, 1, 1},
-  {&__pyx_kp_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 1, 1, 1},
-  {&__pyx_kp_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 0},
-  {&__pyx_kp_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 0},
-  {&__pyx_kp_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 0},
-  {&__pyx_kp_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 0},
-  {&__pyx_kp_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 0},
-  {&__pyx_kp_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 0},
-  {&__pyx_kp_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 0},
-  {&__pyx_kp_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 0},
-  {0, 0, 0, 0, 0, 0}
+  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
+  {&__pyx_kp_u_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 1, 0, 0},
+  {&__pyx_kp_u_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 1, 0, 0},
+  {&__pyx_n_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 1},
+  {&__pyx_kp_u_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 1, 0, 0},
+  {&__pyx_n_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 1},
+  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
+  {&__pyx_kp_u_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 1, 0, 0},
+  {&__pyx_kp_u_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 1, 0, 0},
+  {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0},
+  {&__pyx_kp_u_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 1, 0, 0},
+  {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0},
+  {&__pyx_kp_u_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 1, 0, 0},
+  {&__pyx_n_s__C, __pyx_k__C, sizeof(__pyx_k__C), 0, 0, 1, 1},
+  {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1},
+  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
+  {&__pyx_n_s__SV, __pyx_k__SV, sizeof(__pyx_k__SV), 0, 0, 1, 1},
+  {&__pyx_n_s__T, __pyx_k__T, sizeof(__pyx_k__T), 0, 0, 1, 1},
+  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
+  {&__pyx_n_s__X, __pyx_k__X, sizeof(__pyx_k__X), 0, 0, 1, 1},
+  {&__pyx_n_s__Y, __pyx_k__Y, sizeof(__pyx_k__Y), 0, 0, 1, 1},
+  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
+  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
+  {&__pyx_n_s__base, __pyx_k__base, sizeof(__pyx_k__base), 0, 0, 1, 1},
+  {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1},
+  {&__pyx_n_s__byteorder, __pyx_k__byteorder, sizeof(__pyx_k__byteorder), 0, 0, 1, 1},
+  {&__pyx_n_s__cache_size, __pyx_k__cache_size, sizeof(__pyx_k__cache_size), 0, 0, 1, 1},
+  {&__pyx_n_s__coef0, __pyx_k__coef0, sizeof(__pyx_k__coef0), 0, 0, 1, 1},
+  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
+  {&__pyx_n_s__degree, __pyx_k__degree, sizeof(__pyx_k__degree), 0, 0, 1, 1},
+  {&__pyx_n_s__descr, __pyx_k__descr, sizeof(__pyx_k__descr), 0, 0, 1, 1},
+  {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
+  {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1},
+  {&__pyx_n_s__eps, __pyx_k__eps, sizeof(__pyx_k__eps), 0, 0, 1, 1},
+  {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1},
+  {&__pyx_n_s__float64, __pyx_k__float64, sizeof(__pyx_k__float64), 0, 0, 1, 1},
+  {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
+  {&__pyx_n_s__gamma, __pyx_k__gamma, sizeof(__pyx_k__gamma), 0, 0, 1, 1},
+  {&__pyx_n_s__int32, __pyx_k__int32, sizeof(__pyx_k__int32), 0, 0, 1, 1},
+  {&__pyx_n_s__intercept, __pyx_k__intercept, sizeof(__pyx_k__intercept), 0, 0, 1, 1},
+  {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1},
+  {&__pyx_n_s__kernel_type, __pyx_k__kernel_type, sizeof(__pyx_k__kernel_type), 0, 0, 1, 1},
+  {&__pyx_n_s__label, __pyx_k__label, sizeof(__pyx_k__label), 0, 0, 1, 1},
+  {&__pyx_n_s__nSV, __pyx_k__nSV, sizeof(__pyx_k__nSV), 0, 0, 1, 1},
+  {&__pyx_n_s__names, __pyx_k__names, sizeof(__pyx_k__names), 0, 0, 1, 1},
+  {&__pyx_n_s__nclass_SV, __pyx_k__nclass_SV, sizeof(__pyx_k__nclass_SV), 0, 0, 1, 1},
+  {&__pyx_n_s__ndim, __pyx_k__ndim, sizeof(__pyx_k__ndim), 0, 0, 1, 1},
+  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
+  {&__pyx_n_s__nr_weight, __pyx_k__nr_weight, sizeof(__pyx_k__nr_weight), 0, 0, 1, 1},
+  {&__pyx_n_s__nu, __pyx_k__nu, sizeof(__pyx_k__nu), 0, 0, 1, 1},
+  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
+  {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1},
+  {&__pyx_n_s__p, __pyx_k__p, sizeof(__pyx_k__p), 0, 0, 1, 1},
+  {&__pyx_n_s__probA, __pyx_k__probA, sizeof(__pyx_k__probA), 0, 0, 1, 1},
+  {&__pyx_n_s__probB, __pyx_k__probB, sizeof(__pyx_k__probB), 0, 0, 1, 1},
+  {&__pyx_n_s__probability, __pyx_k__probability, sizeof(__pyx_k__probability), 0, 0, 1, 1},
+  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
+  {&__pyx_n_s__readonly, __pyx_k__readonly, sizeof(__pyx_k__readonly), 0, 0, 1, 1},
+  {&__pyx_n_s__refcheck, __pyx_k__refcheck, sizeof(__pyx_k__refcheck), 0, 0, 1, 1},
+  {&__pyx_n_s__resize, __pyx_k__resize, sizeof(__pyx_k__resize), 0, 0, 1, 1},
+  {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1},
+  {&__pyx_n_s__shrinking, __pyx_k__shrinking, sizeof(__pyx_k__shrinking), 0, 0, 1, 1},
+  {&__pyx_n_s__strides, __pyx_k__strides, sizeof(__pyx_k__strides), 0, 0, 1, 1},
+  {&__pyx_n_s__suboffsets, __pyx_k__suboffsets, sizeof(__pyx_k__suboffsets), 0, 0, 1, 1},
+  {&__pyx_n_s__sv_coef, __pyx_k__sv_coef, sizeof(__pyx_k__sv_coef), 0, 0, 1, 1},
+  {&__pyx_n_s__svm_type, __pyx_k__svm_type, sizeof(__pyx_k__svm_type), 0, 0, 1, 1},
+  {&__pyx_n_s__train_wrap, __pyx_k__train_wrap, sizeof(__pyx_k__train_wrap), 0, 0, 1, 1},
+  {&__pyx_n_s__type_num, __pyx_k__type_num, sizeof(__pyx_k__type_num), 0, 0, 1, 1},
+  {&__pyx_n_s__weight, __pyx_k__weight, sizeof(__pyx_k__weight), 0, 0, 1, 1},
+  {&__pyx_n_s__weight_label, __pyx_k__weight_label, sizeof(__pyx_k__weight_label), 0, 0, 1, 1},
+  {0, 0, 0, 0, 0, 0, 0}
 };
 static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_kp_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_kp_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_kp_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
 }
 
 static int __Pyx_InitGlobals(void) {
-  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -4770,32 +5147,37 @@ PyMODINIT_FUNC PyInit_libsvm(void); /*proto*/
 PyMODINIT_FUNC PyInit_libsvm(void)
 #endif
 {
-  PyObject *__pyx_1 = 0;
-  #ifdef CYTHON_REFNANNY
-  void* __pyx_refchk = NULL;
-  __Pyx_Refnanny = __Pyx_ImportRefcountAPI("refnanny");
-  if (!__Pyx_Refnanny) {
+  PyObject *__pyx_t_1 = NULL;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  #if CYTHON_REFNANNY
+  void* __pyx_refnanny = NULL;
+  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+  if (!__Pyx_RefNanny) {
       PyErr_Clear();
-      __Pyx_Refnanny = __Pyx_ImportRefcountAPI("Cython.Runtime.refnanny");
-      if (!__Pyx_Refnanny)
-          Py_FatalError("failed to import refnanny module");
+      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+      if (!__Pyx_RefNanny)
+          Py_FatalError("failed to import 'refnanny' module");
   }
-  __pyx_refchk = __Pyx_Refnanny->NewContext("PyMODINIT_FUNC PyInit_libsvm(void)", __LINE__, __FILE__);
+  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_libsvm(void)", __LINE__, __FILE__);
   #endif
+  __pyx_init_filenames();
   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #if PY_MAJOR_VERSION < 3
+  __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #else
+  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #endif
   /*--- Library function declarations ---*/
-  __pyx_init_filenames();
   /*--- Threads initialization code ---*/
   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
   #ifdef WITH_THREAD /* Python build with threading support? */
   PyEval_InitThreads();
   #endif
   #endif
-  /*--- Initialize various global constants etc. ---*/
-  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("libsvm"), __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
+  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("libsvm"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_9), 0, PYTHON_API_VERSION);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
@@ -4806,34 +5188,69 @@ PyMODINIT_FUNC PyInit_libsvm(void)
   __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
   if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  /*--- Initialize various global constants etc. ---*/
+  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (__pyx_module_is_main_libsvm) {
-    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_kp___main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   }
   /*--- Builtin init code ---*/
   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_skip_dispatch = 0;
   /*--- Global init code ---*/
   /*--- Function export code ---*/
   /*--- Type init code ---*/
   /*--- Type import code ---*/
-  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject)); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Function import code ---*/
   /*--- Execution code ---*/
 
-  /* "/home/fabian/dev/scikit-learn-svn/scikits/learn/src/libsvm.pyx":41
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":41
  * """
  * 
  * import  numpy as np             # <<<<<<<<<<<<<<
  * cimport numpy as np
  * 
  */
-  __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_1);
-  if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+  /* "/Users/fabian/dev/scikit-learn/scikits/learn/src/libsvm.pyx":1
+ * """             # <<<<<<<<<<<<<<
+ * Binding for libsvm[1]
+ * ---------------------
+ */
+  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__train_wrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__");
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_10), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_11), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__");
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_13), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
-  /* "/usr/lib/pymodules/python2.6/Cython/Includes/stdlib.pxd":2
+  /* "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Cython/Includes/stdlib.pxd":2
  * 
  * cdef extern from "stdlib.h" nogil:             # <<<<<<<<<<<<<<
  *     void free(void *ptr)
@@ -4841,11 +5258,17 @@ PyMODINIT_FUNC PyInit_libsvm(void)
  */
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
-  __Pyx_AddTraceback("libsvm");
-  Py_DECREF(__pyx_m); __pyx_m = 0;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  if (__pyx_m) {
+    __Pyx_AddTraceback("init libsvm");
+    Py_DECREF(__pyx_m); __pyx_m = 0;
+  } else if (!PyErr_Occurred()) {
+    PyErr_SetString(PyExc_ImportError, "init libsvm");
+  }
   __pyx_L0:;
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   #if PY_MAJOR_VERSION < 3
   return;
   #else
@@ -5430,15 +5853,22 @@ static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
   __Pyx_ReleaseBuffer(info);
 }
 
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
-    if (!type) {
+static INLINE long __Pyx_div_long(long a, long b) {
+    long q = a / b;
+    long r = a - q*b;
+    q -= ((r != 0) & ((r ^ b) < 0));
+    return q;
+}
+
+static INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+    if (unlikely(!type)) {
         PyErr_Format(PyExc_SystemError, "Missing type object");
         return 0;
     }
-    if (obj == Py_None || PyObject_TypeCheck(obj, type))
+    if (likely(PyObject_TypeCheck(obj, type)))
         return 1;
-    PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
-        Py_TYPE(obj)->tp_name, type->tp_name);
+    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
+                 Py_TYPE(obj)->tp_name, type->tp_name);
     return 0;
 }
 
@@ -5452,23 +5882,6 @@ static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *t
     PyObject *tmp_type, *tmp_value, *tmp_tb;
     PyThreadState *tstate = PyThreadState_GET();
 
-#if PY_MAJOR_VERSION >= 3
-    /* Note: this is a temporary work-around to prevent crashes in Python 3.0 */
-    if ((tstate->exc_type != NULL) & (tstate->exc_type != Py_None)) {
-        tmp_type = tstate->exc_type;
-        tmp_value = tstate->exc_value;
-        tmp_tb = tstate->exc_traceback;
-        PyErr_NormalizeException(&type, &value, &tb);
-        PyErr_NormalizeException(&tmp_type, &tmp_value, &tmp_tb);
-        tstate->exc_type = 0;
-        tstate->exc_value = 0;
-        tstate->exc_traceback = 0;
-        PyException_SetContext(value, tmp_value);
-        Py_DECREF(tmp_type);
-        Py_XDECREF(tmp_tb);
-    }
-#endif
-
     tmp_type = tstate->curexc_type;
     tmp_value = tstate->curexc_value;
     tmp_tb = tstate->curexc_traceback;
@@ -5492,6 +5905,56 @@ static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **
 }
 
 
+static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+    PyErr_Format(PyExc_ValueError,
+        #if PY_VERSION_HEX < 0x02050000
+                 "need more than %d value%s to unpack", (int)index,
+        #else
+                 "need more than %zd value%s to unpack", index,
+        #endif
+                 (index == 1) ? "" : "s");
+}
+
+static INLINE void __Pyx_RaiseTooManyValuesError(void) {
+    PyErr_SetString(PyExc_ValueError, "too many values to unpack");
+}
+
+static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
+    PyObject *item;
+    if (!(item = PyIter_Next(iter))) {
+        if (!PyErr_Occurred()) {
+            __Pyx_RaiseNeedMoreValuesError(index);
+        }
+    }
+    return item;
+}
+
+static int __Pyx_EndUnpack(PyObject *iter) {
+    PyObject *item;
+    if ((item = PyIter_Next(iter))) {
+        Py_DECREF(item);
+        __Pyx_RaiseTooManyValuesError();
+        return -1;
+    }
+    else if (!PyErr_Occurred())
+        return 0;
+    else
+        return -1;
+}
+
+static INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+}
+
+static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
+    if (t == Py_None) {
+      __Pyx_RaiseNoneNotIterableError();
+    } else if (PyTuple_GET_SIZE(t) < index) {
+      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
+    } else {
+      __Pyx_RaiseTooManyValuesError();
+    }
+}
 
 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
     const char *name, int exact)
@@ -5578,6 +6041,7 @@ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
     return result;
 }
 
+#if PY_MAJOR_VERSION < 3
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
     Py_XINCREF(type);
     Py_XINCREF(value);
@@ -5633,6 +6097,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
             }
         #endif
     }
+
     __Pyx_ErrRestore(type, value, tb);
     return;
 raise_error:
@@ -5642,24 +6107,230 @@ raise_error:
     return;
 }
 
-static INLINE int __Pyx_StrEq(const char *s1, const char *s2) {
-     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
-     return *s1 == *s2;
+#else /* Python 3+ */
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
+    if (tb == Py_None) {
+        tb = 0;
+    } else if (tb && !PyTraceBack_Check(tb)) {
+        PyErr_SetString(PyExc_TypeError,
+            "raise: arg 3 must be a traceback or None");
+        goto bad;
+    }
+    if (value == Py_None)
+        value = 0;
+
+    if (PyExceptionInstance_Check(type)) {
+        if (value) {
+            PyErr_SetString(PyExc_TypeError,
+                "instance exception may not have a separate value");
+            goto bad;
+        }
+        value = type;
+        type = (PyObject*) Py_TYPE(value);
+    } else if (!PyExceptionClass_Check(type)) {
+        PyErr_SetString(PyExc_TypeError,
+            "raise: exception class must be a subclass of BaseException");
+        goto bad;
+    }
+
+    PyErr_SetObject(type, value);
+
+    if (tb) {
+        PyThreadState *tstate = PyThreadState_GET();
+        PyObject* tmp_tb = tstate->curexc_traceback;
+        if (tb != tmp_tb) {
+            Py_INCREF(tb);
+            tstate->curexc_traceback = tb;
+            Py_XDECREF(tmp_tb);
+        }
+    }
+
+bad:
+    return;
+}
+#endif
+
+static INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) {
+    const npy_intp neg_one = (npy_intp)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
+    if (sizeof(npy_intp) <  sizeof(long)) {
+        return PyInt_FromLong((long)val);
+    } else if (sizeof(npy_intp) == sizeof(long)) {
+        if (is_unsigned)
+            return PyLong_FromUnsignedLong((unsigned long)val);
+        else
+            return PyInt_FromLong((long)val);
+    } else { /* (sizeof(npy_intp) > sizeof(long)) */
+        if (is_unsigned)
+            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
+        else
+            return PyLong_FromLongLong((PY_LONG_LONG)val);
+    }
 }
 
+#if CYTHON_CCOMPLEX
+  #ifdef __cplusplus
+    static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+      return ::std::complex< float >(x, y);
+    }
+  #else
+    static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+      return x + y*(__pyx_t_float_complex)_Complex_I;
+    }
+  #endif
+#else
+    static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+      __pyx_t_float_complex z;
+       z.real = x;
+       z.imag = y;
+       return z;
+    }
+#endif
+
+#if CYTHON_CCOMPLEX
+#else
+    static INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+       return (a.real == b.real) && (a.imag == b.imag);
+    }
+    static INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+        __pyx_t_float_complex z;
+        z.real = a.real + b.real;
+        z.imag = a.imag + b.imag;
+        return z;
+    }
+    static INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+        __pyx_t_float_complex z;
+        z.real = a.real - b.real;
+        z.imag = a.imag - b.imag;
+        return z;
+    }
+    static INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+        __pyx_t_float_complex z;
+        z.real = a.real * b.real - a.imag * b.imag;
+        z.imag = a.real * b.imag + a.imag * b.real;
+        return z;
+    }
+    static INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+        __pyx_t_float_complex z;
+        float denom = b.real * b.real + b.imag * b.imag;
+        z.real = (a.real * b.real + a.imag * b.imag) / denom;
+        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
+        return z;
+    }
+    static INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
+        __pyx_t_float_complex z;
+        z.real = -a.real;
+        z.imag = -a.imag;
+        return z;
+    }
+    static INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
+       return (a.real == 0) && (a.imag == 0);
+    }
+    static INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
+        __pyx_t_float_complex z;
+        z.real =  a.real;
+        z.imag = -a.imag;
+        return z;
+    }
+/*
+    static INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
+#if HAVE_HYPOT
+        return hypotf(z.real, z.imag);
+#else
+        return sqrtf(z.real*z.real + z.imag*z.imag);
+#endif
+    }
+*/
+#endif
+
+#if CYTHON_CCOMPLEX
+  #ifdef __cplusplus
+    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+      return ::std::complex< double >(x, y);
+    }
+  #else
+    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+      return x + y*(__pyx_t_double_complex)_Complex_I;
+    }
+  #endif
+#else
+    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+      __pyx_t_double_complex z;
+       z.real = x;
+       z.imag = y;
+       return z;
+    }
+#endif
+
+#if CYTHON_CCOMPLEX
+#else
+    static INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+       return (a.real == b.real) && (a.imag == b.imag);
+    }
+    static INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+        __pyx_t_double_complex z;
+        z.real = a.real + b.real;
+        z.imag = a.imag + b.imag;
+        return z;
+    }
+    static INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+        __pyx_t_double_complex z;
+        z.real = a.real - b.real;
+        z.imag = a.imag - b.imag;
+        return z;
+    }
+    static INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+        __pyx_t_double_complex z;
+        z.real = a.real * b.real - a.imag * b.imag;
+        z.imag = a.real * b.imag + a.imag * b.real;
+        return z;
+    }
+    static INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+        __pyx_t_double_complex z;
+        double denom = b.real * b.real + b.imag * b.imag;
+        z.real = (a.real * b.real + a.imag * b.imag) / denom;
+        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
+        return z;
+    }
+    static INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
+        __pyx_t_double_complex z;
+        z.real = -a.real;
+        z.imag = -a.imag;
+        return z;
+    }
+    static INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
+       return (a.real == 0) && (a.imag == 0);
+    }
+    static INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
+        __pyx_t_double_complex z;
+        z.real =  a.real;
+        z.imag = -a.imag;
+        return z;
+    }
+/*
+    static INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
+#if HAVE_HYPOT
+        return hypot(z.real, z.imag);
+#else
+        return sqrt(z.real*z.real + z.imag*z.imag);
+#endif
+    }
+*/
+#endif
+
 static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
+    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
     if (sizeof(unsigned char) < sizeof(long)) {
         long val = __Pyx_PyInt_AsLong(x);
         if (unlikely(val != (long)(unsigned char)val)) {
-            if (unlikely(val == -1 && PyErr_Occurred()))
-                return (unsigned char)-1;
-            if (unlikely(val < 0)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
                 PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned char");
-                return (unsigned char)-1;
+                    (is_unsigned && unlikely(val < 0)) ?
+                    "can't convert negative value to unsigned char" :
+                    "value too large to convert to unsigned char");
             }
-            PyErr_SetString(PyExc_OverflowError,
-                           "value too large to convert to unsigned char");
             return (unsigned char)-1;
         }
         return (unsigned char)val;
@@ -5668,18 +6339,17 @@ static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
 }
 
 static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
+    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
     if (sizeof(unsigned short) < sizeof(long)) {
         long val = __Pyx_PyInt_AsLong(x);
         if (unlikely(val != (long)(unsigned short)val)) {
-            if (unlikely(val == -1 && PyErr_Occurred()))
-                return (unsigned short)-1;
-            if (unlikely(val < 0)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
                 PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned short");
-                return (unsigned short)-1;
+                    (is_unsigned && unlikely(val < 0)) ?
+                    "can't convert negative value to unsigned short" :
+                    "value too large to convert to unsigned short");
             }
-            PyErr_SetString(PyExc_OverflowError,
-                           "value too large to convert to unsigned short");
             return (unsigned short)-1;
         }
         return (unsigned short)val;
@@ -5688,18 +6358,17 @@ static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
 }
 
 static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
+    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
     if (sizeof(unsigned int) < sizeof(long)) {
         long val = __Pyx_PyInt_AsLong(x);
         if (unlikely(val != (long)(unsigned int)val)) {
-            if (unlikely(val == -1 && PyErr_Occurred()))
-                return (unsigned int)-1;
-            if (unlikely(val < 0)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
                 PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to unsigned int");
-                return (unsigned int)-1;
+                    (is_unsigned && unlikely(val < 0)) ?
+                    "can't convert negative value to unsigned int" :
+                    "value too large to convert to unsigned int");
             }
-            PyErr_SetString(PyExc_OverflowError,
-                           "value too large to convert to unsigned int");
             return (unsigned int)-1;
         }
         return (unsigned int)val;
@@ -5708,13 +6377,17 @@ static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
 }
 
 static INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
+    const char neg_one = (char)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
     if (sizeof(char) < sizeof(long)) {
         long val = __Pyx_PyInt_AsLong(x);
         if (unlikely(val != (long)(char)val)) {
-            if (unlikely(val == -1 && PyErr_Occurred()))
-                return (char)-1;
-            PyErr_SetString(PyExc_OverflowError,
-                           "value too large to convert to char");
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (is_unsigned && unlikely(val < 0)) ?
+                    "can't convert negative value to char" :
+                    "value too large to convert to char");
+            }
             return (char)-1;
         }
         return (char)val;
@@ -5723,13 +6396,17 @@ static INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
 }
 
 static INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
+    const short neg_one = (short)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
     if (sizeof(short) < sizeof(long)) {
         long val = __Pyx_PyInt_AsLong(x);
         if (unlikely(val != (long)(short)val)) {
-            if (unlikely(val == -1 && PyErr_Occurred()))
-                return (short)-1;
-            PyErr_SetString(PyExc_OverflowError,
-                           "value too large to convert to short");
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (is_unsigned && unlikely(val < 0)) ?
+                    "can't convert negative value to short" :
+                    "value too large to convert to short");
+            }
             return (short)-1;
         }
         return (short)val;
@@ -5738,13 +6415,17 @@ static INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
 }
 
 static INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
+    const int neg_one = (int)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
     if (sizeof(int) < sizeof(long)) {
         long val = __Pyx_PyInt_AsLong(x);
         if (unlikely(val != (long)(int)val)) {
-            if (unlikely(val == -1 && PyErr_Occurred()))
-                return (int)-1;
-            PyErr_SetString(PyExc_OverflowError,
-                           "value too large to convert to int");
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (is_unsigned && unlikely(val < 0)) ?
+                    "can't convert negative value to int" :
+                    "value too large to convert to int");
+            }
             return (int)-1;
         }
         return (int)val;
@@ -5753,13 +6434,17 @@ static INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
 }
 
 static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
+    const signed char neg_one = (signed char)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
     if (sizeof(signed char) < sizeof(long)) {
         long val = __Pyx_PyInt_AsLong(x);
         if (unlikely(val != (long)(signed char)val)) {
-            if (unlikely(val == -1 && PyErr_Occurred()))
-                return (signed char)-1;
-            PyErr_SetString(PyExc_OverflowError,
-                           "value too large to convert to signed char");
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (is_unsigned && unlikely(val < 0)) ?
+                    "can't convert negative value to signed char" :
+                    "value too large to convert to signed char");
+            }
             return (signed char)-1;
         }
         return (signed char)val;
@@ -5768,13 +6453,17 @@ static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
 }
 
 static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
+    const signed short neg_one = (signed short)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
     if (sizeof(signed short) < sizeof(long)) {
         long val = __Pyx_PyInt_AsLong(x);
         if (unlikely(val != (long)(signed short)val)) {
-            if (unlikely(val == -1 && PyErr_Occurred()))
-                return (signed short)-1;
-            PyErr_SetString(PyExc_OverflowError,
-                           "value too large to convert to signed short");
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (is_unsigned && unlikely(val < 0)) ?
+                    "can't convert negative value to signed short" :
+                    "value too large to convert to signed short");
+            }
             return (signed short)-1;
         }
         return (signed short)val;
@@ -5783,13 +6472,17 @@ static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
 }
 
 static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
+    const signed int neg_one = (signed int)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
     if (sizeof(signed int) < sizeof(long)) {
         long val = __Pyx_PyInt_AsLong(x);
         if (unlikely(val != (long)(signed int)val)) {
-            if (unlikely(val == -1 && PyErr_Occurred()))
-                return (signed int)-1;
-            PyErr_SetString(PyExc_OverflowError,
-                           "value too large to convert to signed int");
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (is_unsigned && unlikely(val < 0)) ?
+                    "can't convert negative value to signed int" :
+                    "value too large to convert to signed int");
+            }
             return (signed int)-1;
         }
         return (signed int)val;
@@ -5798,10 +6491,12 @@ static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
 }
 
 static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
+    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) {
+    if (likely(PyInt_Check(x))) {
         long val = PyInt_AS_LONG(x);
-        if (unlikely(val < 0)) {
+        if (is_unsigned && unlikely(val < 0)) {
             PyErr_SetString(PyExc_OverflowError,
                             "can't convert negative value to unsigned long");
             return (unsigned long)-1;
@@ -5809,13 +6504,17 @@ static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
         return (unsigned long)val;
     } else
 #endif
-    if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) {
-        if (unlikely(Py_SIZE(x) < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned long");
-            return (unsigned long)-1;
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+            if (unlikely(Py_SIZE(x) < 0)) {
+                PyErr_SetString(PyExc_OverflowError,
+                                "can't convert negative value to unsigned long");
+                return (unsigned long)-1;
+            }
+            return PyLong_AsUnsignedLong(x);
+        } else {
+            return PyLong_AsLong(x);
         }
-        return PyLong_AsUnsignedLong(x);
     } else {
         unsigned long val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
@@ -5827,10 +6526,12 @@ static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
 }
 
 static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
+    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) {
+    if (likely(PyInt_Check(x))) {
         long val = PyInt_AS_LONG(x);
-        if (unlikely(val < 0)) {
+        if (is_unsigned && unlikely(val < 0)) {
             PyErr_SetString(PyExc_OverflowError,
                             "can't convert negative value to unsigned PY_LONG_LONG");
             return (unsigned PY_LONG_LONG)-1;
@@ -5838,13 +6539,17 @@ static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x)
         return (unsigned PY_LONG_LONG)val;
     } else
 #endif
-    if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) {
-        if (unlikely(Py_SIZE(x) < 0)) {
-            PyErr_SetString(PyExc_OverflowError,
-                            "can't convert negative value to unsigned PY_LONG_LONG");
-            return (unsigned PY_LONG_LONG)-1;
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+            if (unlikely(Py_SIZE(x) < 0)) {
+                PyErr_SetString(PyExc_OverflowError,
+                                "can't convert negative value to unsigned PY_LONG_LONG");
+                return (unsigned PY_LONG_LONG)-1;
+            }
+            return PyLong_AsUnsignedLongLong(x);
+        } else {
+            return PyLong_AsLongLong(x);
         }
-        return PyLong_AsUnsignedLongLong(x);
     } else {
         unsigned PY_LONG_LONG val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
@@ -5856,14 +6561,30 @@ static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x)
 }
 
 static INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
+    const long neg_one = (long)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) {
+    if (likely(PyInt_Check(x))) {
         long val = PyInt_AS_LONG(x);
+        if (is_unsigned && unlikely(val < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to long");
+            return (long)-1;
+        }
         return (long)val;
     } else
 #endif
-    if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) {
-        return PyLong_AsLong(x);
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+            if (unlikely(Py_SIZE(x) < 0)) {
+                PyErr_SetString(PyExc_OverflowError,
+                                "can't convert negative value to long");
+                return (long)-1;
+            }
+            return PyLong_AsUnsignedLong(x);
+        } else {
+            return PyLong_AsLong(x);
+        }
     } else {
         long val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
@@ -5875,14 +6596,30 @@ static INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
 }
 
 static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
+    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) {
+    if (likely(PyInt_Check(x))) {
         long val = PyInt_AS_LONG(x);
+        if (is_unsigned && unlikely(val < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to PY_LONG_LONG");
+            return (PY_LONG_LONG)-1;
+        }
         return (PY_LONG_LONG)val;
     } else
 #endif
-    if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) {
-        return PyLong_AsLongLong(x);
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+            if (unlikely(Py_SIZE(x) < 0)) {
+                PyErr_SetString(PyExc_OverflowError,
+                                "can't convert negative value to PY_LONG_LONG");
+                return (PY_LONG_LONG)-1;
+            }
+            return PyLong_AsUnsignedLongLong(x);
+        } else {
+            return PyLong_AsLongLong(x);
+        }
     } else {
         PY_LONG_LONG val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
@@ -5894,14 +6631,30 @@ static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
 }
 
 static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
+    const signed long neg_one = (signed long)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) {
+    if (likely(PyInt_Check(x))) {
         long val = PyInt_AS_LONG(x);
+        if (is_unsigned && unlikely(val < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to signed long");
+            return (signed long)-1;
+        }
         return (signed long)val;
     } else
 #endif
-    if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) {
-        return PyLong_AsLong(x);
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+            if (unlikely(Py_SIZE(x) < 0)) {
+                PyErr_SetString(PyExc_OverflowError,
+                                "can't convert negative value to signed long");
+                return (signed long)-1;
+            }
+            return PyLong_AsUnsignedLong(x);
+        } else {
+            return PyLong_AsLong(x);
+        }
     } else {
         signed long val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
@@ -5913,14 +6666,30 @@ static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
 }
 
 static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
+    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
+    const int is_unsigned = neg_one > const_zero;
 #if PY_VERSION_HEX < 0x03000000
-    if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) {
+    if (likely(PyInt_Check(x))) {
         long val = PyInt_AS_LONG(x);
+        if (is_unsigned && unlikely(val < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to signed PY_LONG_LONG");
+            return (signed PY_LONG_LONG)-1;
+        }
         return (signed PY_LONG_LONG)val;
     } else
 #endif
-    if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) {
-        return PyLong_AsLongLong(x);
+    if (likely(PyLong_Check(x))) {
+        if (is_unsigned) {
+            if (unlikely(Py_SIZE(x) < 0)) {
+                PyErr_SetString(PyExc_OverflowError,
+                                "can't convert negative value to signed PY_LONG_LONG");
+                return (signed PY_LONG_LONG)-1;
+            }
+            return PyLong_AsUnsignedLongLong(x);
+        } else {
+            return PyLong_AsLongLong(x);
+        }
     } else {
         signed PY_LONG_LONG val;
         PyObject *tmp = __Pyx_PyNumber_Int(x);
@@ -6007,7 +6776,6 @@ static void __Pyx_AddTraceback(const char *funcname) {
     PyObject *py_srcfile = 0;
     PyObject *py_funcname = 0;
     PyObject *py_globals = 0;
-    PyObject *empty_string = 0;
     PyCodeObject *py_code = 0;
     PyFrameObject *py_frame = 0;
 
@@ -6034,12 +6802,6 @@ static void __Pyx_AddTraceback(const char *funcname) {
     if (!py_funcname) goto bad;
     py_globals = PyModule_GetDict(__pyx_m);
     if (!py_globals) goto bad;
-    #if PY_MAJOR_VERSION < 3
-    empty_string = PyString_FromStringAndSize("", 0);
-    #else
-    empty_string = PyBytes_FromStringAndSize("", 0);
-    #endif
-    if (!empty_string) goto bad;
     py_code = PyCode_New(
         0,            /*int argcount,*/
         #if PY_MAJOR_VERSION >= 3
@@ -6048,7 +6810,7 @@ static void __Pyx_AddTraceback(const char *funcname) {
         0,            /*int nlocals,*/
         0,            /*int stacksize,*/
         0,            /*int flags,*/
-        empty_string, /*PyObject *code,*/
+        __pyx_empty_bytes, /*PyObject *code,*/
         __pyx_empty_tuple,  /*PyObject *consts,*/
         __pyx_empty_tuple,  /*PyObject *names,*/
         __pyx_empty_tuple,  /*PyObject *varnames,*/
@@ -6057,7 +6819,7 @@ static void __Pyx_AddTraceback(const char *funcname) {
         py_srcfile,   /*PyObject *filename,*/
         py_funcname,  /*PyObject *name,*/
         __pyx_lineno,   /*int firstlineno,*/
-        empty_string  /*PyObject *lnotab*/
+        __pyx_empty_bytes  /*PyObject *lnotab*/
     );
     if (!py_code) goto bad;
     py_frame = PyFrame_New(
@@ -6072,7 +6834,6 @@ static void __Pyx_AddTraceback(const char *funcname) {
 bad:
     Py_XDECREF(py_srcfile);
     Py_XDECREF(py_funcname);
-    Py_XDECREF(empty_string);
     Py_XDECREF(py_code);
     Py_XDECREF(py_frame);
 }
@@ -6080,7 +6841,7 @@ bad:
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
-        if (t->is_unicode && (!t->is_identifier)) {
+        if (t->is_unicode) {
             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
         } else if (t->intern) {
             *t->p = PyString_InternFromString(t->s);
@@ -6088,10 +6849,14 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
         }
         #else  /* Python 3+ has unicode identifiers */
-        if (t->is_identifier || (t->is_unicode && t->intern)) {
-            *t->p = PyUnicode_InternFromString(t->s);
-        } else if (t->is_unicode) {
-            *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+        if (t->is_unicode | t->is_str) {
+            if (t->intern) {
+                *t->p = PyUnicode_InternFromString(t->s);
+            } else if (t->encoding) {
+                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+            } else {
+                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+            }
         } else {
             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
         }
@@ -6193,3 +6958,4 @@ static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
 }
 
 
+#endif /* Py_PYTHON_H */
diff --git a/scikits/learn/src/libsvm.pyx b/scikits/learn/src/libsvm.pyx
index ed081dd989..0c16dc27e0 100644
--- a/scikits/learn/src/libsvm.pyx
+++ b/scikits/learn/src/libsvm.pyx
@@ -62,11 +62,11 @@ cdef extern from "libsvm_helper.c":
     svm_problem *set_problem(char *, char *, np.npy_intp *)
     svm_model *set_model(svm_parameter *, int, char *, np.npy_intp *, np.npy_intp *,
                          char *, char *, char *, char *, char *, char *)
-    void copy_sv_coef (char *, svm_model *, np.npy_intp *)
-    void copy_rho     (char *, svm_model *, np.npy_intp *)
-    void copy_SV      (char *, svm_model *, np.npy_intp *)
+    void copy_sv_coef   (char *, svm_model *, np.npy_intp *)
+    void copy_intercept (char *, svm_model *, np.npy_intp *)
+    void copy_SV        (char *, svm_model *, np.npy_intp *)
     int  copy_predict (char *, svm_model *, np.npy_intp *, char *)
-    int  copy_prob_predict (char *, svm_model *, np.npy_intp *, char *)
+    int  copy_predict_proba (char *, svm_model *, np.npy_intp *, char *)
     void copy_nSV     (char *, svm_model *)
     void copy_label   (char *, svm_model *)
     void copy_probA(char *, svm_model *, np.npy_intp *)
@@ -86,12 +86,16 @@ def train_wrap (  np.ndarray[np.float64_t, ndim=2, mode='c'] X,
                   np.ndarray[np.float64_t, ndim=1, mode='c'] Y, int
                   svm_type, int kernel_type, int degree, double gamma,
                   double coef0, double eps, double C, int nr_weight,
-                  np.ndarray[np.int32_t, ndim=1] weight_label,
-                  np.ndarray[np.float64_t, ndim=1] weight, double nu,
-                  double cache_size, double p, int shrinking, int
-                  probability):
+                  np.ndarray[np.float64_t, ndim=2, mode='c'] SV,
+                  np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef,
+                  np.ndarray[np.float64_t, ndim=1, mode='c'] intercept,
+                  np.ndarray[np.int32_t,   ndim=1, mode='c'] weight_label,
+                  np.ndarray[np.float64_t, ndim=1, mode='c'] weight,
+                  np.ndarray[np.int32_t,   ndim=1, mode='c'] nclass_SV,
+                  double nu, double cache_size, double p, int
+                  shrinking, int probability):
     """
-    Wrapper for svm_train in libsvm
+    Wrap svm_train from libsvm
 
     Parameters
     ----------
@@ -100,7 +104,9 @@ def train_wrap (  np.ndarray[np.float64_t, ndim=2, mode='c'] X,
     Y: array, dtype=float, size=[N]
         target vector
 
-    Optional Parameters
+    ...
+
+    Notes
     -------------------
     See scikits.learn.svm.predict for a complete list of parameters.
 
@@ -108,7 +114,7 @@ def train_wrap (  np.ndarray[np.float64_t, ndim=2, mode='c'] X,
     ------
     sv_coef: array of coeficients for support vector in decision
             function (aka alphas)
-    rho : array
+    intercept : array
         constants in decision functions
     SV : array-like
         support vectors
@@ -141,29 +147,29 @@ def train_wrap (  np.ndarray[np.float64_t, ndim=2, mode='c'] X,
     # call svm_train, this does the real work
     model = svm_train(problem, param)
 
-    cdef int nSV = get_l(model)
+    cdef int SV_len = get_l(model)
     cdef int nr = get_nr(model)
 
-    # copy model.sv_coef 
-    cdef np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef
-    sv_coef = np.empty((nr-1, nSV))
+    # copy model.sv_coef
+    # we create a new array instead of resizing, otherwise
+    # it would not erase previous information
+    sv_coef.resize((nr-1, SV_len), refcheck=False)
     copy_sv_coef(sv_coef.data, model, sv_coef.strides)
 
-    # copy model.rho
-    cdef np.ndarray[np.float64_t, ndim=1, mode='c'] rho 
-    rho = np.empty(nr*(nr-1)/2)
-    copy_rho(rho.data, model, rho.shape)
+    # copy model.rho into the intercept
+    # the intercept is just model.rho but with sign changed
+    intercept.resize(nr*(nr-1)/2, refcheck=False)
+    copy_intercept(intercept.data, model, intercept.shape)
 
     # copy model.SV
-    cdef np.ndarray[np.float64_t, ndim=2, mode='c'] SV
-    SV = np.zeros((nSV, X.shape[1]))
-    copy_SV(SV.data, model, SV.strides)
+    # we erase any previous information in SV
+    SV.resize((0,0), refcheck=False)
+    SV.resize((SV_len, X.shape[1]), refcheck=False)
+    copy_SV(SV.data, model, SV.shape)
 
     # copy model.nSV
-    # name is a bit confusing since we used nSV to denote the total number
-    # of support vectors
-    cdef np.ndarray[np.int32_t, ndim=1, mode='c'] nclass_SV
-    nclass_SV = np.empty((nr), dtype=np.int32)
+    # TODO: do only in classification
+    nclass_SV.resize(nr, refcheck=False)
     copy_nSV(nclass_SV.data, model)
 
     # copy label
@@ -185,20 +191,20 @@ def train_wrap (  np.ndarray[np.float64_t, ndim=2, mode='c'] X,
     free_problem(problem)
     free_param(param)
 
-    return sv_coef, rho, SV, nr, nclass_SV, label, probA, probB
+    return label, probA, probB
 
 
 def predict_from_model_wrap(np.ndarray[np.float64_t, ndim=2, mode='c'] T,
                             np.ndarray[np.float64_t, ndim=2, mode='c'] SV,
                             np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef,
                             np.ndarray[np.float64_t, ndim=1, mode='c']
-                            rho, int svm_type, int kernel_type, int
+                            intercept, int svm_type, int kernel_type, int
                             degree, double gamma, double coef0, double
                             eps, double C, int nr_weight,
                             np.ndarray[np.int32_t, ndim=1] weight_label,
                             np.ndarray[np.float64_t, ndim=1] weight,
                             double nu, double cache_size, double p, int
-                            shrinking, int probability, int nr_class,
+                            shrinking, int probability,
                             np.ndarray[np.int32_t, ndim=1, mode='c'] nSV,
                             np.ndarray[np.int32_t, ndim=1, mode='c'] label,
                             np.ndarray[np.float64_t, ndim=1, mode='c'] probA,
@@ -236,9 +242,10 @@ def predict_from_model_wrap(np.ndarray[np.float64_t, ndim=2, mode='c'] T,
                           coef0, nu, cache_size, C, eps, p, shrinking,
                           probability, nr_weight, weight_label.data,
                           weight.data)
-    model = set_model(param, nr_class, SV.data, SV.shape, sv_coef.strides,
-                      sv_coef.data, rho.data, nSV.data, label.data,
-                      probA.data, probB.data)
+
+    model = set_model(param, nSV.shape[0], SV.data, SV.shape,
+                      sv_coef.strides, sv_coef.data, intercept.data,
+                      nSV.data, label.data, probA.data, probB.data)
     #TODO: use check_model
     dec_values = np.empty(T.shape[0])
     if copy_predict(T.data, model, T.shape, dec_values.data) < 0:
@@ -254,13 +261,13 @@ def predict_prob_from_model_wrap(np.ndarray[np.float64_t, ndim=2, mode='c'] T,
                             np.ndarray[np.float64_t, ndim=2, mode='c'] SV,
                             np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef,
                             np.ndarray[np.float64_t, ndim=1, mode='c']
-                            rho, int svm_type, int kernel_type, int
+                            intercept, int svm_type, int kernel_type, int
                             degree, double gamma, double coef0, double
                             eps, double C, int nr_weight,
                             np.ndarray[np.int32_t, ndim=1] weight_label,
                             np.ndarray[np.float_t, ndim=1] weight,
                             double nu, double cache_size, double p, int
-                            shrinking, int probability, int nr_class,
+                            shrinking, int probability,
                             np.ndarray[np.int32_t, ndim=1, mode='c'] nSV,
                             np.ndarray[np.int32_t, ndim=1, mode='c'] label,
                             np.ndarray[np.float64_t, ndim=1, mode='c'] probA,
@@ -298,13 +305,13 @@ def predict_prob_from_model_wrap(np.ndarray[np.float64_t, ndim=2, mode='c'] T,
                           coef0, nu, cache_size, C, eps, p, shrinking,
                           probability, nr_weight, weight_label.data,
                           weight.data)
-    model = set_model(param, nr_class, SV.data, SV.shape, sv_coef.strides,
-                      sv_coef.data, rho.data, nSV.data, label.data,
+    model = set_model(param, nSV.shape[0], SV.data, SV.shape, sv_coef.strides,
+                      sv_coef.data, intercept.data, nSV.data, label.data,
                       probA.data, probB.data)
 
     cdef int nr = get_nr(model)    
     dec_values = np.empty((T.shape[0], nr), dtype=np.float64)
-    if copy_prob_predict(T.data, model, T.shape, dec_values.data) < 0:
+    if copy_predict_proba(T.data, model, T.shape, dec_values.data) < 0:
         raise MemoryError("We've run out of of memory")
     # free model and param
     free_model_SV(model)
diff --git a/scikits/learn/src/libsvm_helper.c b/scikits/learn/src/libsvm_helper.c
index 56bb31ca6e..136d997f07 100644
--- a/scikits/learn/src/libsvm_helper.c
+++ b/scikits/learn/src/libsvm_helper.c
@@ -1,4 +1,5 @@
 #include <stdlib.h>
+#include <stdio.h>
 #include "svm.h"
 #include <numpy/arrayobject.h>
 
@@ -189,7 +190,9 @@ struct svm_model *set_model(struct svm_parameter *param, int nr_class,
         t += sv_coef_strides[0]; 
     }
 
-    memcpy(model->rho, rho, m * sizeof(double));
+    for (i=0; i<m; ++i) 
+        (model->rho)[i] = -((double *) rho)[i];
+
     /* 
      * just to avoid segfaults, these features are not wrapped but
      * svm_destroy_model will try to free them.
@@ -244,9 +247,17 @@ void copy_sv_coef(char *data, struct svm_model *model, npy_intp *strides)
     }
 }
 
-void copy_rho(char *data, struct svm_model *model, npy_intp *dims)
+void copy_intercept(char *data, struct svm_model *model, npy_intp *dims)
 {
-    memcpy(data, model->rho, dims[0] * sizeof(double));
+    /* intercept = -rho */
+    int i, n = dims[0];
+    double t, *ddata = (double *) data;
+    for (i=0; i<n; ++i) {
+        t = model->rho[i];
+        /* we do this to avoid ugly -0.0 */
+        *ddata = (t != 0) ? -t : 0;
+        ++ddata;
+    }
 }
 
 /* 
@@ -254,19 +265,18 @@ void copy_rho(char *data, struct svm_model *model, npy_intp *dims)
  * structures, so we have to do the conversion on the fly and also
  * iterate fast over data.
  */
-void copy_SV(char *data, struct svm_model *model, npy_intp *strides)
+void copy_SV(char *data, struct svm_model *model, npy_intp *dims)
 {
-    register int i, j;
-    char *t = data;
-    int k, n = model->l;
-    npy_intp step = strides[1];
+    int i, j, k, n = model->l;
+    double *t = (double *) data;
+    int step = dims[1] * sizeof(double);
     for (i=0; i<n; ++i) {
-        k = model->SV[i][0].index;
-        for(j=0; k >= 0; ++j) {
-            * ((double *) (t + (k-1)*step)) = model->SV[i][j].value;
-            k = model->SV[i][j+1].index;
+        k = model->SV[i][0].index - 1;
+        for(j=0; k >=0 ; ++j) {
+            t[k] = model->SV[i][j].value;
+            k = model->SV[i][j+1].index - 1;
         }
-        t += strides[0];
+        t += dims[1];
     }
 }
 
@@ -326,10 +336,9 @@ int copy_predict(char *predict, struct svm_model *model, npy_intp *predict_dims,
     return 0;
 }
 
-int copy_prob_predict(char *predict, struct svm_model *model, npy_intp *predict_dims,
+int copy_predict_proba(char *predict, struct svm_model *model, npy_intp *predict_dims,
                  char *dec_values)
 {
-    double *t = (double *) dec_values;
     register int i;
     int n, m;
     n = predict_dims[0];
diff --git a/scikits/learn/svm.py b/scikits/learn/svm.py
index acb19a9c75..8282943708 100644
--- a/scikits/learn/svm.py
+++ b/scikits/learn/svm.py
@@ -1,13 +1,11 @@
 import numpy as np
 from . import libsvm, liblinear
 
-_kernel_types = ['linear', 'poly', 'rbf', 'sigmoid', 'precomputed']
-_svm_types = ['c_svc', 'nu_svc', 'one_class', 'epsilon_svr', 'nu_svr']
-
 
 class BaseLibsvm(object):
     """
-    Base class for classifiers that use support vector machine.
+    Base class for classifiers that use libsvm as library for
+    support vector machine classification and regression.
 
     Should not be used directly, use derived classes instead
 
@@ -19,17 +17,23 @@ class BaseLibsvm(object):
         target vector relative to X
         It will be converted to a floating-point array.
     """
-    support_ = None
-    dual_coef_ = None
-    rho_ = None
+    support_ = np.empty((0,0), dtype=np.float64, order='C')
+    dual_coef_ = np.empty((0,0), dtype=np.float64, order='C')
+    intercept_ = np.empty(0, dtype=np.float64, order='C')
+
+    # only used in classification
+    nSV_ = np.empty(0, dtype=np.int32, order='C')
+
+    weight = np.empty(0, dtype=np.float64, order='C')
+    weight_label = np.empty(0, dtype=np.int32, order='C')
 
-    weight = np.empty(0, dtype=np.float64)
-    weight_label = np.empty(0, dtype=np.int32)
+    _kernel_types = ['linear', 'poly', 'rbf', 'sigmoid', 'precomputed']
+    _svm_types = ['c_svc', 'nu_svc', 'one_class', 'epsilon_svr', 'nu_svr']
 
     def __init__(self, impl, kernel, degree, gamma, coef0, cache_size,
                  eps, C, nr_weight, nu, p, shrinking, probability):
-        self.svm = _svm_types.index(impl)
-        self.kernel = _kernel_types.index(kernel)
+        self.solver_type = self._svm_types.index(impl)
+        self.kernel = self._kernel_types.index(kernel)
         self.degree = degree
         self.gamma = gamma
         self.coef0 = coef0
@@ -42,9 +46,9 @@ class BaseLibsvm(object):
         self.shrinking = int(shrinking)
         self.probability = int(probability)
 
-    def fit(self, X, y):
+    def fit(self, X, Y):
         """
-        Fit the model with vectors X, Y.
+        Fit the SVM model according to the given training data and parameters.
 
         Parameters
         ----------
@@ -52,54 +56,86 @@ class BaseLibsvm(object):
             Training vector, where nsamples in the number of samples and
             nfeatures is the number of features.
         Y : array, shape = [nsamples]
-            Target vector relative to X
-
+            Target values (integers in classification, real numbers in
+            regression)
         """
         X = np.asanyarray(X, dtype=np.float64, order='C')
-        y = np.asanyarray(y, dtype=np.float64, order='C')
+        Y = np.asanyarray(Y, dtype=np.float64, order='C')
 
         # check dimensions
-        if X.shape[0] != y.shape[0]: raise ValueError("Incompatible shapes")
+        if X.shape[0] != Y.shape[0]: raise ValueError("Incompatible shapes")
 
         if (self.gamma == 0): self.gamma = 1.0/X.shape[0]
-        self.dual_coef_, self.rho_, self.support_, self.nclass_, self.nSV_, \
-                 self.label_, self.probA_, self.probB_ = libsvm.train_wrap(X, y,
-                 self.svm, self.kernel, self.degree, self.gamma,
-                 self.coef0, self.eps, self.C, self.nr_weight,
-                 self.weight_label, self.weight, self.nu, self.cache_size, self.p,
-                 self.shrinking, int(self.probability))
+        self.label_, self.probA_, self.probB_ = libsvm.train_wrap(X, Y,
+                 self.solver_type, self.kernel, self.degree,
+                 self.gamma, self.coef0, self.eps, self.C,
+                 self.nr_weight, self.support_, self.dual_coef_,
+                 self.intercept_, self.weight_label, self.weight,
+                 self.nSV_, self.nu, self.cache_size, self.p,
+                 self.shrinking,
+                 int(self.probability))
         return self
 
+
     def predict(self, T):
+        """
+        This function does classification or regression on an array of
+        test vectors T.
+
+        For a classification model, the predicted class for each
+        sample in T is returned.
+        For a regression model, the function value of T calculated is
+        returned.
+
+        For an one-class model, +1 or -1 is returned.
+
+        Parameters
+        ----------
+        T : array-like, shape = [nsamples, nfeatures]
+
+        Returns
+        -------
+        C : array, shape = [nsample]
+        """
         T = np.atleast_2d(np.asanyarray(T, dtype=np.float64, order='C'))
         return libsvm.predict_from_model_wrap(T, self.support_,
-                      self.dual_coef_, self.rho_, self.svm,
-                      self.kernel, self.degree, self.gamma,
-                      self.coef0, self.eps, self.C, self.nr_weight,
-                      self.weight_label, self.weight, self.nu,
-                      self.cache_size,
-                      self.p, self.shrinking, self.probability,
-                      self.nclass_, self.nSV_, self.label_,
-                      self.probA_, self.probB_)
+                      self.dual_coef_, self.intercept_,
+                      self.solver_type, self.kernel, self.degree,
+                      self.gamma, self.coef0, self.eps, self.C,
+                      self.nr_weight, self.weight_label, self.weight,
+                      self.nu, self.cache_size, self.p,
+                      self.shrinking, self.probability,
+                      self.nSV_, self.label_, self.probA_,
+                      self.probB_)
 
     def predict_proba(self, T):
+        """
+        This function does classification or regression on a test vector T
+        given a model with probability information.
+
+        For a classification model with probability information, this
+        function returns nr_class probability estimates in the array
+        prob_estimates. For regression/one-class SVM, the array prob_estimates
+        is unchanged and the returned value is the same as that of
+        svm_predict.        
+
+        Parameters
+        ----------
+        T : array-like, shape = [nsamples, nfeatures]
+        """
         if not self.probability:
             raise ValueError("probability estimates must be enabled to use this method")
         T = np.atleast_2d(np.asanyarray(T, dtype=np.float64, order='C'))
         return libsvm.predict_prob_from_model_wrap(T, self.support_,
-                      self.dual_coef_, self.rho_, self.svm,
+                      self.dual_coef_, self.intercept_, self.solver_type,
                       self.kernel, self.degree, self.gamma,
                       self.coef0, self.eps, self.C, self.nr_weight,
                       self.weight_label, self.weight,
                       self.nu, self.cache_size,
                       self.p, self.shrinking, self.probability,
-                      self.nclass_, self.nSV_, self.label_,
+                      self.nSV_, self.label_,
                       self.probA_, self.probB_)
 
-    @property
-    def intercept_(self):
-        return - self.rho_
-
 ###
 # Public API
 # No processing should go into these classes
@@ -115,6 +151,7 @@ class SVC(BaseLibsvm):
     X : array-like, shape = [nsamples, nfeatures]
         Training vector, where nsamples in the number of samples and
         nfeatures is the number of features.
+
     Y : array, shape = [nsamples]
         Target vector relative to X
 
@@ -178,27 +215,18 @@ class SVC(BaseLibsvm):
     SVR
     """
 
-    def __init__(self, impl='c_svc', kernel='rbf', degree=3,
-                 gamma=0.0, coef0=0.0, cache_size=100.0, eps=1e-3,
-                 C=1.0, nr_weight=0, nu=0.5, p=0.1, shrinking=True,
-                 probability=False):
+    def __init__(self, impl='c_svc', kernel='rbf', degree=3, gamma=0.0, coef0=0.0,
+                 cache_size=100.0, eps=1e-3, C=1.0, nr_weight=0,
+                 nu=0.5, p=0.1, shrinking=True, probability=False):
         BaseLibsvm.__init__(self, impl, kernel, degree, gamma, coef0,
                          cache_size, eps, C, nr_weight, nu, p,
                          shrinking, probability)
 
-
     @property
     def coef_(self):
-        if _kernel_types[self.kernel] != 'linear':
+        if self._kernel_types[self.kernel] != 'linear':
             raise NotImplementedError('coef_ is only available when using a linear kernel')
-        if self.support_.size == 0:
-            raise Exception, 'No support vector'
-
-        coef_ = []
-        for i in range(self.dual_coef_.shape[0]):
-            coef_.append(np.dot(self.dual_coef_[i], self.support_))
-        coef_ = np.array(coef_)
-        return coef_
+        return np.dot(self.dual_coef_, self.support_)
 
 class SVR(BaseLibsvm):
     """
@@ -227,28 +255,13 @@ class SVR(BaseLibsvm):
     --------
     SVC
     """
-    def __init__(self, impl='epsilon_svr', kernel='rbf', degree=3,
-                 gamma=0.0, coef0=0.0, cache_size=100.0, eps=1e-3,
-                 C=1.0, nr_weight=0, nu=0.5, p=0.1, shrinking=True,
-                 probability=False):
-        BaseLibsvm.__init__(self, impl, kernel, degree, gamma, coef0,
+    def __init__(self, kernel='rbf', degree=3, gamma=0.0, coef0=0.0,
+                 cache_size=100.0, eps=1e-3, C=1.0, nr_weight=0,
+                 nu=0.5, p=0.1, shrinking=True, probability=False):
+        BaseLibsvm.__init__(self, 'epsilon_svr', kernel, degree, gamma, coef0,
                          cache_size, eps, C, nr_weight, nu, p,
                          shrinking, probability)
 
-    @property
-    def coef_(self):
-        if _kernel_types[self.kernel] != 'linear':
-            raise NotImplementedError(
-            'coef_ is only available when using a linear kernel')
-        if self.support_.size == 0:
-            raise Exception, 'No support vector'
-
-        coef_ = []
-        for i in range(self.dual_coef_.shape[0]):
-            coef_.append(np.dot(self.dual_coef_[i], self.support_))
-        coef_ = np.array(coef_)
-        return coef_
-
 class OneClassSVM(BaseLibsvm):
     """
     Outlayer detection
@@ -261,12 +274,10 @@ class OneClassSVM(BaseLibsvm):
     predict(X) : array
         Predict using the model.
     """
-    def __init__(self, kernel='rbf', degree=3,
-                 gamma=0.0, coef0=0.0, cache_size=100.0, eps=1e-3,
-                 C=1.0, nr_weight=0, nu=0.5, p=0.1, shrinking=True,
-                 probability=False):
-        impl = 'one_class'
-        BaseLibsvm.__init__(self, impl, kernel, degree, gamma, coef0,
+    def __init__(self, kernel='rbf', degree=3, gamma=0.0, coef0=0.0,
+                 cache_size=100.0, eps=1e-3, C=1.0, nr_weight=0,
+                 nu=0.5, p=0.1, shrinking=True, probability=False):
+        BaseLibsvm.__init__(self, 'one_class', kernel, degree, gamma, coef0,
                          cache_size, eps, C, nr_weight, nu, p,
                          shrinking, probability)
 
@@ -311,33 +322,36 @@ class LinearSVC(object):
     http://www.csie.ntu.edu.tw/~cjlin/liblinear/
 
     """
-    _solver_type = {'l2l2_1': 1, 'l2l2_0' : 2, 'l2l1_1' : 3, 'l1l2_0' : 5}
-
-    def __init__(self, penalty='l2', loss='l2', dual=True, eps=1e-4, C=1.0):
-        s = penalty + loss + '_' + str(int(dual))
-        print s
-        try: self.solver_type = self._solver_type[s]
-        except KeyError:
-            raise ValueError('Not supported set of arguments')
-        self.eps = eps
-        self.C = C
 
-    _penalties = {'l2': 0, 'l1' : 6}
     _weight_label = np.empty(0, dtype=np.int32)
     _weight = np.empty(0, dtype=np.float64)
 
+    _solver_type_dict = {
+        'PL2_LL2_D1' : 1, # L2 penalty, L2 loss, dual problem
+        'PL2_LL2_D0' : 2, # L2 penalty, L2 loss, primal problem
+        'PL2_LL1_D1' : 3, # L2 penalty, L1 Loss, dual problem
+        'PL1_LL2_D0' : 5, # L2 penalty, L1 Loss, primal problem
+        }
+
+    def __init__(self, penalty='L2', loss='L2', dual=True, eps=1e-4, C=1.0):
+        self.solver_type = 'P' + penalty + '_L' + loss + '_D' + str(int(dual))
+        if not (self.solver_type in self._solver_type_dict.keys()):
+            raise ValueError('Not supported set of arguments: ' + self.solver_type)
+        self.eps = eps
+        self.C = C
+
     def fit(self, X, Y):
         X = np.asanyarray(X, dtype=np.float64, order='C')
         Y = np.asanyarray(Y, dtype=np.int32, order='C')
-        self.coef_with_intercept_, self.label_, self.bias_ = liblinear.train_wrap(X,
-                                          Y, self.solver_type, self.eps, 1.0,
-                                          self.C, 0,
-                                          self._weight_label,
-                                          self._weight)
+        self.raw_coef, self.label_, self.bias_ = \
+                       liblinear.train_wrap(X, Y,
+                       self._solver_type_dict[self.solver_type],
+                       self.eps, 1.0, self.C, 0, self._weight_label,
+                       self._weight)
 
     def predict(self, T):
         T = np.atleast_2d(np.asanyarray(T, dtype=np.float64, order='C'))
-        return liblinear.predict_wrap(T, self.coef_with_intercept_, self.solver_type,
+        return liblinear.predict_wrap(T, self.raw_coef, self._solver_type_dict[self.solver_type],
                                       self.eps, self.C,
                                       self._weight_label,
                                       self._weight, self.label_,
@@ -348,9 +362,9 @@ class LinearSVC(object):
 
     @property
     def intercept_(self):
-        return self.coef_with_intercept_[:,-1]
+        return self.raw_coef[:,-1]
 
     @property
     def coef_(self):
-        return self.coef_with_intercept_[:,:-1]
+        return self.raw_coef[:,:-1]
 
diff --git a/scikits/learn/tests/test_svm.py b/scikits/learn/tests/test_svm.py
index c6a694be51..976d684424 100644
--- a/scikits/learn/tests/test_svm.py
+++ b/scikits/learn/tests/test_svm.py
@@ -4,30 +4,79 @@ from numpy.testing import assert_array_equal, \
                           assert_array_almost_equal, \
                           assert_raises
 
-# Data is just 6 separable points in the plane
-X = np.array( [[-2,-1], [-1, -1], [-1, -2], [1,1], [1,2], [2, 1]])
-Y = np.array( [1, 1, 1, 2, 2, 2])
-T = np.array( [[-1,-1], [2, 2], [3, 2]] )
+# test sample 1
+X =  [[-2,-1], [-1, -1], [-1, -2], [1,1], [1,2], [2, 1]]
+Y =  [1, 1, 1, 2, 2, 2]
+T =  [[-1,-1], [2, 2], [3, 2]]
 true_result = [1, 2, 2]
 
-def test_svm_params():
+# test sample 2
+X2 = [[0, 0, 0], [1, 1, 1], [2, 0, 0, ],
+      [0, 0, 2], [3, 3, 3]]
+Y2 = [1, 2, 2, 2, 3]
+T2 = [[-1, -1, -1], [1, 1, 1], [2, 2, 2]]
+true_result2 = [1, 2, 3]
+
+def test_CSVC():
     """
     C_SVC algorithm and linear kernel.
 
-    This checks that we retrieve the correct parameters.
+    We test this on two datasets, the first one with two classes and
+    the second one with three classes. We check for predicted values
+    and estimated parameters.
+
+    TODO: check with different parameters of C
     """
 
-    clf =  svm.SVC(kernel='linear')
+    clf = svm.SVC(kernel='linear')
     clf.fit(X, Y)
-
+    pred = clf.predict(T)
     assert_array_equal(clf.dual_coef_, [[ 0.25, -.25]])
     assert_array_equal(clf.support_, [[-1,-1], [1, 1]])
-    assert_array_equal(clf.rho_, [0.])
+    assert_array_equal(clf.intercept_, [0.])
+    assert_array_equal(pred, true_result)
+
+    clf.fit(X2, Y2)
+    pred = clf.predict(T2)
+    assert_array_almost_equal(clf.dual_coef_,
+                              [[ .99, -.006, -.49, -.49, -.07],
+                               [ .072, .16, 0, 0, -.16]], decimal=2)
+    assert_array_equal(clf.support_,
+                       [[ 0.,  0.,  0.],
+                        [ 1.,  1.,  1.],
+                        [ 2.,  0.,  0.],
+                        [ 0.,  0.,  2.],
+                        [ 3.,  3.,  3.]])
+    assert_array_equal(pred, true_result2)
+
+
+def test_SVR():
+    """
+    Test SVM regression
+    TODO: simplify this. btw, is it correct ?
+    """
+
+    clf = svm.SVR()
+    clf.fit(X, Y)
+    pred = clf.predict(T)
+
+    assert_array_almost_equal(clf.dual_coef_,
+                              [[-0.01441007, -0.51530605, -0.01365979,
+                                0.51569493, 0.01387495, 0.01380604]])
+    print clf.support_
+    assert_array_almost_equal(clf.support_, X)
+    assert_array_almost_equal(pred,[ 1.10001274,  1.86682485,  1.73300377])
+
+
+def test_oneclass():
+    """
+    FIXME: this does nothing
+    """
+    clf = svm.OneClassSVM()
+    clf.fit(X, Y)
+    assert_array_equal(Y, [1, 1, 1, 2, 2, 2])
+
 
-def test_fit():
-    clf = svm.SVC()
-    clf.fit([[1,2]], [0])
-    assert_array_equal(clf.predict([[-1, -1]]), [0.])
 
 def test_tweak_params():
     """
@@ -47,94 +96,58 @@ def test_tweak_params():
     clf.dual_coef_ = np.array([[.0, 1.]])
     assert_array_equal(clf.predict([[-.1, -.1]]), [2])
 
-def test_error():
-    """
-    Test that it gives proper exception on deficient input
-    """
-    # impossible value of nu
-    clf = svm.SVC(impl='nu_svc', kernel='linear', nu=0.0)
-    assert_raises(ValueError, clf.fit, X, Y)
-
-    Y2 = Y[:-1] # wrong dimensions for labels
-    assert_raises(ValueError, svm.SVC, X, Y2)
-
-def test_predict():
-    clf = svm.SVC()
-    clf.fit(X, Y)
-    assert_array_equal(clf.predict(T), true_result)
-
 
 def test_probability():
     """
-    predict probabilities
+    predict probabilities.
+    FIXME: is it harmless that we obtain slightly different results on
+    different operating systems ? (that is why we only check for 1
+    decimal precission)
+    TODO: test also on an example with intercept != 0
     """
     clf = svm.SVC(probability=True)
     clf.fit(X, Y)
     assert_array_almost_equal(clf.predict_proba(T),
                               [[ 0.81936054,  0.18063946],
                                [ 0.18923853,  0.81076147],
-                               [ 0.27698362,  0.72301638]])
+                               [ 0.27698362,  0.72301638]],
+                              decimal=1)
 
-def test_noncontiguous():
+def test_error():
     """
-    Test with arrays that are non-contiguous.
+    Test that it gives proper exception on deficient input
     """
-    Xt = X.transpose()
+    # impossible value of nu
+    clf = svm.SVC(impl='nu_svc', kernel='linear', nu=0.0)
+    assert_raises(ValueError, clf.fit, X, Y)
+
+    Y2 = Y[:-1] # wrong dimensions for labels
+    assert_raises(ValueError, svm.SVC, X, Y2)
+
+    # Test with arrays that are non-contiguous.
+    Xt = np.array(X).transpose()
     Yt = [1, 2]
     clf = svm.SVC()
     clf.fit(Xt, Yt)
     assert_array_equal(clf.predict(T), [1, 2, 2])
 
-def test_predict_multiclass():
-    """
-    this example is from libsvm/README
-    """
-    X  =   [[0,     0.1,    0.2,    0,      0],
-            [ 0,  0.1,      0.3,   -1.2,    0],
-            [0.4,  0,   0,      0,      0],
-            [0,     0.1,    0,      1.4,    0.5],
-            [-0.1,-0.2,     0.1,    1.1,    0.1]]
-    Y = [1,2,1,2,3]
-    test = [[0, 1, 0, -1, 0]]
-    clf = svm.SVC()
-    clf.fit(X, Y)
-    result = clf.predict(test)
-    assert_array_equal(result, [2])
-
-def test_regression():
-    """
-    Test SVM regression
-    TODO: simplify this. btw, is it correct ?
-    """
-    clf = svm.SVR()
-    clf.fit([[0,0], [1, 1]], [0, 1])
-    assert_array_almost_equal(clf.predict([[0,0], [1, 1]]), [.099999, .9])
-
-def test_oneclass():
-    """
-    FIXME: this does nothing
-    """
-    clf = svm.OneClassSVM()
-    clf.fit(X, Y)
-    assert_array_equal(Y, [1, 1, 1, 2, 2, 2])
-
 def test_LinearSVC():
     clf = svm.LinearSVC()
     clf.fit(X, Y)
     assert_array_equal(clf.predict(T), true_result)
 
     # the same with l1 penalty
-    clf = svm.LinearSVC(penalty='l1', dual=False)
+    clf = svm.LinearSVC(penalty='L1', dual=False)
     clf.fit(X, Y)
     assert_array_equal(clf.predict(T), true_result)
 
     # l2 penalty with dual formulation
-    clf = svm.LinearSVC(penalty='l2', dual=True)
+    clf = svm.LinearSVC(penalty='L2', dual=True)
     clf.fit(X, Y)
     assert_array_equal(clf.predict(T), true_result)
 
     #
-    clf = svm.LinearSVC(penalty='l2', loss='l1', dual=True)
+    clf = svm.LinearSVC(penalty='L2', loss='L1', dual=True)
     clf.fit(X, Y)
     assert_array_equal(clf.predict(T), true_result)
 
@@ -144,11 +157,11 @@ def test_coef_and_intercept_SVC_vs_LinearSVC():
     """
     svc = svm.SVC(kernel='linear', C=1)
     svc.fit(X, Y)
-    linsvc = svm.LinearSVC(C=1, penalty='l2', loss='l1', dual=True)
+    linsvc = svm.LinearSVC(C=1, penalty='L2', loss='L1', dual=True)
     linsvc.fit(X, Y)
 
     assert_array_equal(linsvc.coef_.shape, svc.coef_.shape)
     assert_array_almost_equal(linsvc.coef_, svc.coef_, 5)
     assert_array_almost_equal(linsvc.intercept_, svc.intercept_, 6)
 
-    
\ No newline at end of file
+    
-- 
GitLab