FIXED: Bug in RCM node sorting

Added test to verify
Not sure if it is optimized in cython.  I can just make the switch.

On Jul 15, 2014, at 10:17 PM, Robert Johansson <notifications@github.com> wrote:

> In qutip/cy/graph_utils.pyx:
> 
> >      cdef unsigned int zz, i, j, ii, jj, kk, ll
> >  
> >      cdef np.ndarray[ITYPE_t] order = np.zeros(num_rows, dtype=ITYPE)
> >      cdef np.ndarray[ITYPE_t] degree = _node_degrees(ind, ptr, num_rows).astype(ITYPE)
> >      cdef np.ndarray[ITYPE_t] inds = np.argsort(degree).astype(ITYPE)
> >      cdef np.ndarray[ITYPE_t] rev_inds = np.argsort(inds).astype(ITYPE)
> > -    cdef np.ndarray[ITYPE_t] temp_degrees = np.zeros(num_rows, dtype=ITYPE)
> > +    cdef np.ndarray[ITYPE_t] temp_degrees = np.zeros(max(degree), dtype=ITYPE)
> How about using numpys max on ndarrays, degree.max(), instead of pythons max function? Or maybe cython already takes card of this in a good way?
> 
> —
> Reply to this email directly or view it on GitHub.
>