[SciPy-user] Nonlinear Constraint Optimization.

eric eric at scipy.org
Thu Jan 10 12:03:13 EST 2002


Depending upon what the Omuses/HQP  library looks like, SWIG may handle it
fine.  After all, wxPython uses it, and it is a huge library.  Also, David
B. has released a new version recently and I think it supports C++ much
better.  If Omuses/HQP has a large number of overloaded procedures, then
SWIG used to not handle this -- at least automatically.  I still don't think
it is automatic, but it can do it.  I'm pretty sure this is why the VTK guys
didn't use SWIG as VTK overloads functions many many many times...  On the
other hand, if the classes don't have many overloaded functions and
operators, then SWIG will handle it pretty well.  You'll still have to write
the typemaps though, which is an adventure no matter how you cut it.

I've never used boost.  It may be better for the task.  I just didn't want
SWIG dismissed as not handling C++ well.

One other option I've noticed is the Cable project associated with VTK.  The
gcc-xml tool looks really cool.  I doubt this is the fastest way to
wrappers -- use one of the above -- but it is worth keeping an eye on.

http://public.kitware.com/Cable/

eric

----- Original Message -----
From: "Pearu Peterson" <pearu at cens.ioc.ee>
To: "SciPy" <scipy-user at scipy.org>
Sent: Thursday, January 10, 2002 9:31 AM
Subject: Re: [SciPy-user] Nonlinear Constraint Optimization.


>
> On Thu, 10 Jan 2002, H Jansen wrote:
>
> > Solving a system with Omuses/HQP involves writing a class (that inherits
> > from Omuses_Problem or HQP_Problem) with a set of differential (or
> > difference) equations in C++, linking them with the library; the
> > solution process is initialized/controled with Tcl scripts.
> >
> > Wouldn't it be wonderful if this all could be done from within a Python
> > environment? To that end, the following Python interfaces should be
> > available:
> >
> > 1. One to meschach, and the partially implemented C++ interface,
> > meschach++, may work as a start;
> > 2. One to the Hqp_Program class;
> > 3. One to the Hqp_SeqProgram class;
> > 4. One to the Omuses_Program class;
> >
> > I've tried to make a start with meschach using SWIG which is geared
> > towards C, creating functions that can be wrapped by shadow classes in
> > Python. However, the boost.python library also provides an "interface
> > builder" which provides a tighter coupling between C/C++ and Python.
> >
> > After a while, I had to give up, because I feel I'm lacking the
> > experience to make the correct decisions. Preferably, I would team up
> > with other people that may be interested and join into a shared project
> > in which we can share ideas and build things quicker.
> >
> > Are there people interested? I'm open to all ideas.
>
> If the supporting library for solving the problem in the subject is in
> C++ then I would recommend boost.python for exposing C++ to Python. Though
> to get started with boost.python might seem difficult (I am not sure if it
> is easier with other C++/Python binding tools) but not impossible (I
> started with many concers about C++ that just fade away with using g++
> compiler), with the right design decision of the interface, it will be
> very small and easy to maintain.
> Using SWIG for wrapping C++ classes is not very good idea, I think.
>
> I have this good experience with interfacing GiNaC C++ library to
> Python that provides classes for doing symbolic algebra computations.
> See
>   http://cens.ioc.ee/projects/pyginac/
> (I suggest getting it from CVS as the tar balls are very outdated, in
> case you are interested in the approach).
>
>
> Regards,
> Pearu
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
>





More information about the SciPy-User mailing list