My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 20: segfault in eval_jac_g, sparsity structure
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by spcornel...@gmail.com, Mar 7, 2013
I get a segfault when I run a modified version of the hs071 example,
in which I have changed the eval_jac_g function to instead compute the sparsity
structure using numpy's "where". The relevant section of the code (attached) reads:

def eval_jac_g(x, flag, user_data = None):
	r =  array([ x[1]*x[2]*x[3], 
					x[0]*x[2]*x[3], 
					x[0]*x[1]*x[3], 
					x[0]*x[1]*x[2],
					2.0*x[0], 
					2.0*x[1], 
					2.0*x[2], 
					2.0*x[3] ])
	if flag:
            return where(ones(r.shape))
	else:
            return r

The original example works fine but in this case I get:

[Callback:E] eval_jac_g
[Error] there are problems with row or col in eval_jac_g.

IndexError: tuple index out of range
Segmentation fault (core dumped)

I can reproduce this with pyipopt 0.8 on both Ubuntu 12.10 
and OSX 10.8 (python 2.7.3, numpy 1.6.2, and ipopt 3.10.3 in both cases). It may seem silly to rewrite the example in this way that makes it fail, but this is exactly how openopt computes the sparsity structure so I similarly get segfaults in all of their examples.

Thanks! Keep up the great work,
-Sean
hs071.py
3.6 KB   View   Download

Powered by Google Project Hosting