Issue 7: Crash when using object methods as callbacks
Status:  WontFix
Owner: ----
Closed:  Aug 2010
Reported by jorn.baa...@gmail.com, Apr 1, 2009
Pyipopt.create does not like being passing object methods as eval_f, etc. 

Something like

class Test:
  def eval_f(self, x):
    return x[0] ** 2 + x[1] ** 2

  ...

  def run(self):
    nlp = pyipopt.create( ... )
    opt, zl, zu, obj = nlp.solve(x_0)
    nlp.close()

will illustrate the problem.
May 1, 2009
Project Member #1 xu.mathena
thank you for reporting this, I will test it.
Jun 14, 2010
Project Member #2 r.w.linc...@gmail.com
I believe the crash can be avoided if the method is not passed directly to create().  For example:

def run(self):
    f = self.eval_f
    nlp = pyipopt.create(..., f,...)
    ...
Aug 18, 2010
Project Member #3 xu.mathena
This is because in OO, we need a "self" reference to use a member function. I think r.w.lincoln gives a perfect solution (where you use self explicitly). Pyipopt requires a function that is independent of the lexicon environment. It is the fundamental limitation posed by the IPOPT callback function design. 
Status: WontFix