[SciPy-dev] bug: indexing CSR matrix, 64bits

Robert Cimrman cimrman3@ntc.zcu...
Fri May 9 04:46:08 CDT 2008


Hi,

indexing by slices is broken on a 64 bit machine. On a 32 bit one, all 
is ok. Is something missing in the INSTANTIATE_ALL macro in sparsetools.i?

r.

In [1]: import scipy

In [2]: scipy.__version__
Out[2]: '0.7.0.dev4195'

In [3]: import numpy

In [4]: numpy.__version__
Out[4]: '1.1.0.dev5106'


(Pdb) mtx
<12160x12160 sparse matrix of type '<type 'numpy.float64'>'
         with 235578 stored elements in Compressed Sparse Row format>
(Pdb) mtx.data
array([ 0.        ,  0.        ,  0.        , ..., -0.00540995,
        -0.00636418,  0.0202062 ])
(Pdb) mtx.data.dtype
dtype('float64')
(Pdb) mtx.indices
array([    0,     1,    36, ..., 12136, 12155, 12159], dtype=int32)
(Pdb) mtx.indptr
array([     0,     15,     30, ..., 235543, 235560, 235578], dtype=int32)
(Pdb) ir
slice(8974, 12160, None)
(Pdb) ic
slice(8974, 12160, None)
(Pdb) mtx[ir,ic]
*** NotImplementedError: Wrong number of arguments for overloaded 
function 'get_csr_submatrix'.
   Possible C/C++ prototypes are:
     get_csr_submatrix< int,signed char >(int const,int const,int const 
[],int const [],signed char const [],int const,int const,int const,int 
const,std::vector< int > *,std::vector< int > *,std::vector< signed char 
 > *)
     get_csr_submatrix< int,unsigned char >(int const,int const,int 
const [],int const [],unsigned char const [],int const,int const,int 
const,int const,std::vector< int > *,std::vector< int > *,std::vector< 
unsigned char > *)
     get_csr_submatrix< int,short >(int const,int const,int const [],int 
const [],short const [],int const,int const,int const,int 
const,std::vector< int > *,std::vector< int > *,std::vector< short > *)
     get_csr_submatrix< int,unsigned short >(int const,int const,int 
const [],int const [],unsigned short const [],int const,int const,int 
const,int const,std::vector< int > *,std::vector< int > *,std::vector< 
unsigned short > *)
     get_csr_submatrix< int,int >(int const,int const,int const [],int 
const [],int const [],int const,int const,int const,int 
const,std::vector< int > *,std::vector< int > *,std::vector< int > *)
     get_csr_submatrix< int,unsigned int >(int const,int const,int const 
[],int const [],unsigned int const [],int const,int const,int const,int 
const,std::vector< int > *,std::vector< int > *,std::vector< unsigned 
int > *)
     get_csr_submatrix< int,long long >(int const,int const,int const 
[],int const [],long long const [],int const,int const,int const,int 
const,std::vector< int > *,std::vector< int > *,std::vector< long long > *)
     get_csr_submatrix< int,unsigned long long >(int const,int const,int 
const [],int const [],unsigned long long const [],int const,int 
const,int const,int const,std::vector< int > *,std::vector< int > 
*,std::vector< unsigned long long > *)
     get_csr_submatrix< int,float >(int const,int const,int const [],int 
const [],float const [],int const,int const,int const,int 
const,std::vector< int > *,std::vector< int > *,std::vector< float > *)
     get_csr_submatrix< int,double >(int const,int const,int const 
[],int const [],double const [],int const,int const,int const,int 
const,std::vector< int > *,std::vector< int > *,std::vector< double > *)
     get_csr_submatrix< int,long double >(int const,int const,int const 
[],int const [],long double const [],int const,int const,int const,int 
const,std::vector< int > *,std::vector< int > *,std::vector< long double 
 > *)
     get_csr_submatrix< int,npy_cfloat_wrapper >(int const,int const,int 
const [],int const [],npy_cfloat_wrapper const [],int const,int 
const,int const,int const,std::vector< int > *,std::vector< int > 
*,std::vector< npy_cfloat_wrapper > *)
     get_csr_submatrix< int,npy_cdouble_wrapper >(int const,int 
const,int const [],int const [],npy_cdouble_wrapper const [],int 
const,int const,int const,int const,std::vector< int > *,std::vector< 
int > *,std::vector< npy_cdouble_wrapper > *)
     get_csr_submatrix< int,npy_clongdouble_wrapper >(int const,int 
const,int const [],int const [],npy_clongdouble_wrapper const [],int 
const,int const,int const,int const,std::vector< int > *,std::vector< 
int > *,std::vector< npy_clongdouble_wrapper > *)


More information about the Scipy-dev mailing list