def solve(self): bx = self.bx.get_cvx() bc = self.bc.get_cvx() X = conelp(self.c) X.aux.pushLinConstraint(bx['mat'], bx['vec']) X.aux.pushLinConstraint(bc['mat'], bc['vec']) return X.solve()
def solve(self): c = numpy.concatenate([self.qp.lp.c, self.penalty.v]) X = conelp(c) bx = self.qp.lp.bx.get_cvx() bc = self.qp.lp.bc.get_cvx() qc = self.qp.qc.get_cvx() p = self.penalty.getCVX() X.aux.pushLinConstraint(numpy.hstack([bx['mat'], numpy.zeros(bx['mat'].shape)]), bx['vec']) X.aux.pushLinConstraint(numpy.hstack([bc['mat'], numpy.zeros(bc['mat'].shape)]), bc['vec']) X.aux.pushLinConstraint(p['mat'], p['vec']) X.aux.pushQuadConstraint(numpy.hstack([qc['mat'], numpy.zeros(qc['mat'].shape)]), qc['vec']) x = X.solve() return x[0][0:len(self.qp.lp.c)], x[1]