Skip to content

Instantly share code, notes, and snippets.

@jgillis
Created July 15, 2016 11:34
Show Gist options
  • Save jgillis/25ea8fe2c44823ff9492217ce060ed50 to your computer and use it in GitHub Desktop.
Save jgillis/25ea8fe2c44823ff9492217ce060ed50 to your computer and use it in GitHub Desktop.
from casadi import *
H = DM([[1,-1],[-1,2]])
G = DM([-2,-6])
A = DM([[1, 1],[-1, 2],[2, 1]])
LBA = DM([-inf]*3)
UBA = DM([2, 2, 3])
LBX = DM([0]*2)
UBX = DM([inf]*2)
solver = casadi.qpsol("mysolver","qpoases",{'h':H.sparsity(),'a':A.sparsity()})
print solver(h=H,g=G,a=A,lbx=LBX,ubx=UBX,lba=LBA,uba=UBA)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment