[PPL-devel] Re: A question on powerset operations
bagnara at cs.unipr.it
Tue Nov 9 20:03:28 CET 2004
Hosung Song wrote:
> Thank you very much. Encouraged by your prompt feedback, I decided to
> try to implement my own C interface for those polyhedra powerset
> operations. All I need is just three operations: creation of an empty
> powerset, add a disjunct, and finally check if a polyhedron is contained
> (geometrically covered) by a powerset. (Maybe I would need more later.)
> Since my C++ knowledge is very shallow, it took quite a long time to
> figure out how (after all, most answers I found from the ppl_c.cc),
> especially how to deal with the compile errors due to differences in
> Polyhedron and NNC_Polyhedron. Polyhedra_PowerSet is defined as a
> template class, and I just don't know much how to deal with one
> effectively. I tried various different ad hoc trials, and it turns out
> that there's a simple casting operation, which I found in another
> portion of ppl_c.cc. Anyway, I know my implementation may be too
> specific for my purpose, but I'd like you to look over it and give me
> some confirmation.
first of all, please accept my apologies for the delay with which I am
answering. The last couple of weeks have been tough ones, and things
do not seem to get any better.
I have looked at your code and it seems correct.
> It seems that the integration works well for my
> project right now, but who knows if my implementation is just completely
> bogus. I'm attaching the diffs for interfaces/C/ppl_c.cc and
> interfaces/C/ppl_c.h.in. All diffs are just additions to the original
> ppl_c.cc and ppl_c.h.in. I know they are really tiny, but it took me a
> novice C++ user quite a few hours. Any of your comments would be greatly
Your code looks OK. If it runs (I assume you have tested it) and it does
what you want it to do, then you are all set.
> I'd be happy if you somehow incorporate this kind of C
> interface in the new release. In fact, I thought of coding this as a
> separate source file, maybe under my project directory, because I didn't
> want to modify the PPL distribution. However, my lack of knowledge on
> how to compile it and manage as a library prohibited that approach. If
> you could give me a pointer on general methods of making C interface for
> library written in C++, I would certainly try that.
This is an issue we are thinking about. I will try to summarize
where we are in the next messages.
All the best, and sorry again for the delay,
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
mailto:bagnara at cs.unipr.it
More information about the PPL-devel