From: brett h. <bha...@ya...> - 2004-03-25 23:36:38
|
That is one of the big problems, that boost can not use the dReal types directly. Below is the response i got from the boost.python mailing list. """Is dReal a typedef for double or float? If so: Python float are immutable. You cannot return pointers to immutable types. Somehow you have to change your interface, e.g. through the use of "thin wrappers." Please explain in more detail what exactly you want to do; hopefully this will lead us to the best solution.""" - Ralf Unfortunately, i don't know why boost now requires the internal 'dx' types to also be wrapped. I hope that i am able to change how the c++ wrappers are working so that it will not be needed to expose those internal types to python. It may also be possible to do this the other way round, by changing the boost wrappers rather than the c++ wrappers, but how to do that is beyond my boost skillz. -brett --- "Martin C. Martin" <ma...@me...> wrote: > Alright, I resubscribed. > > > The current c++ wrappers function as a thin layer ontop of the C API, > > which i think works well for c++ programmers. > > "Thin layer" just means that Russ did a good job with his object > oriented design, so that IDs that ODE returns corresponded to objects, > and function calls to methods. That made the wrapper trivial to > implement, although it required a surprizing amount of tweaking to get > it where I wanted. I suggest you do the same with Python. > > > But, for the purposes of making the python wrappers, they need to be > thicker, > > and more object oriented. > > Hmm, why is this? Just because "thin is trivial, so thicker is better"? > > > The big change i guess would be enclosing the dReals inside a new > > vector or matrix object. > > I've never integrated C code into python, but can't it access a > contiguous set of floats as a vector or an array? Doesn't it already > have types that do that? > > > If dxSpace is being used by a > > class, then dxSpace must also be exposed to boost, > > I don't see why. Can't Python manipulate dxSpace through an ID, the way > it presumably does with everything else? You could store the handle in > the "user data" field. > > - Martin > > __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html |