[SciPy-user] weave inline returning a multimap to a dict nested within c++

Michael ODonnell odonnems at yahoo.com
Fri Dec 14 01:13:45 EST 2007


I would like to convert a multimap created within c++ to a python dictionary in order to return the value. I think I need to do it this way because I have a multimap (potential for redundant keys) that needs to be sorted. I am using scipy.weave.inline with converters.blitz. If you think there is a better way I am open to what ever may work. Although, I prefer to stick with weave.inline blitz converter--This is all new and there are a lot of components to wrapping c++ in python.

Anyhow, I tired this:
py::dict ckmap_freq = map_freq;
return_val = ckmap_freq;

And received this error:
error: conversion from `std::multimap<double, std::string, std::less<double>, std::allocator<std::pair<const double, std::string> > >' to non-scalar type `py::dict' requested

I was able to successfully use a similar method but with a vector instead. Therefore, it is likely I need to change the syntax.

thanks for any suggestions and help,
Michael





      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20071213/1b9810e3/attachment.html>


More information about the SciPy-User mailing list