Discussion:
[Pyublas] Trouble with numpy_vector<int>
Janosch Peters
2010-09-25 22:44:06 UTC
Permalink
Hi list,

I used pyublas for some time now and never had any issues, however now
I face some sort of conversion error I cannot figure out. My c++
function dignature looks like this:

double asc(numpy_matrix<double> codebook, numpy_matrix<double> data,
numpy_vector<int> assignments)


On the python side, I create the value for the third parameter like
this:

assignments = numpy.zeros(4, dtype=int)


But this fails when I run the code:

ArgumentError: Python argument types in
mergecb.asc(numpy.ndarray, numpy.ndarray, numpy.ndarray)
did not match C++ signature:
asc(pyublas::numpy_matrix<double,
boost::numeric::ublas::basic_row_major<unsigned long, int> >,
pyublas::numpy_matrix<double,
boost::numeric::ublas::basic_row_major<unsigned long, int> >,
pyublas::numpy_vector<int>)


The funny thing is, if I exchange int with float, every thing works.
But I really need an int (an unsigned int would be even better).

Any ideas what's going wrong?

cheers,
Janosch




Janosch Peters, BSc.
Brunnerstra?e 39
80804 M?nchen

+49 (0)89 8908 1882
+49 (0)176 2418 2959


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Janosch Peters.vcf
Type: text/directory
Size: 394 bytes
Desc: not available
URL: <http://lists.tiker.net/pipermail/pyublas/attachments/20100926/ff64a965/attachment.bin>
-------------- next part --------------

Loading...