Skip to content

Instantly share code, notes, and snippets.

@ghorn
Created March 11, 2016 12:46
Show Gist options
  • Save ghorn/57a0267c6008c15d2686 to your computer and use it in GitHub Desktop.
Save ghorn/57a0267c6008c15d2686 to your computer and use it in GitHub Desktop.
# check for inequalities
for k in range(arg['lbx'].shape[0]):
lbx = arg['lbx'].cat[k]
ubx = arg['ubx'].cat[k]
if lbx == ubx:
pass
elif lbx == -np.inf and ubx == np.inf:
pass
else:
raise ValueError('x index %d is an inequality (%.3g, %.3g)' % (k, lbx, ubx))
for k in range(arg['lbg'].shape[0]):
lbg = arg['lbg'].cat[k]
ubg = arg['ubg'].cat[k]
if lbg == ubg:
pass
elif lbg == -np.inf and ubg == np.inf:
pass
else:
raise ValueError('g index %d is an inequality (%.3g, %.3g)' % (k, lbg, ubg))
res = solver(arg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment