QpStructure
- class flopt.convert.QpStructure(Q, c, C, G=None, h=None, A=None, b=None, lb=None, ub=None, types='Continuous', x=None)[source]
Quadratic Programming Structure
obj 1/2 x.T.dot(Q).dot(x) + c.T.dot(x) + C s.t. Gx <= h Ax == b lb <= x <= ub
- boundsToIneq()[source]
convert bounds constraints into inequality constraints
obj 1/2 x.T.dot(Q).dot(x) + c.T.dot(x) + C s.t. [G; -I; I] x <= [h; -lb; ub] A x == b
- Return type:
- classmethod fromFlopt(prob, x=None, option=None, progress=False)[source]
- Parameters:
prob (Problem) –
x (None or list of VarElement family) –
progress (bool) –
option ({"ineq", "eq"}) –
- Return type:
- toEq()[source]
convert all eqaual constraint type
obj 1/2 x.T.dot([Q, O; O, O]).dot([x; s]) + [c; O].T.dot([x; s]) + C s.t. [A, O; G, I] [x; s] == [b; h] lb <= x <= ub 0 <= s
- toIneq()[source]
convert all non eqaual constraint type
obj 1/2 x.T.dot(Q).dot(x) + c.T.dot(x) + C s.t. [G; A; -A] x <= [h; b; -b] lb <= x <= ub
- Return type:
LpStructure
- class flopt.convert.LpStructure(c, C, G=None, h=None, A=None, b=None, lb=None, ub=None, types='Continuous', x=None)[source]
Linear Programming Structure
obj c.T.dot(x) + C s.t. Gx <= h Ax == b lb <= x <= ub
- classmethod fromFlopt(prob, x=None, option=None, progress=False)[source]
Problem (flopt) --> QpStructure --> LpStructure
- Parameters:
prob (Problem) –
x (None or list of Variable family) –
option ({"ineq", "eq"}) –
progress (bool) –
- Return type:
- toFlopt(var_name='x')[source]
LpStructure --> QpStructure --> Problem (flopt)
- Parameters:
var_name (str) – variable prefix
- Return type:
IsingStructure
- class flopt.convert.IsingStructure(J, h, C, x=None)[source]
Ising Structure
obj - x.T.dot(J).dot(x) - h.T.dot(x) + C s.t. x in {-1, 1}^N
QuboStructure
- class flopt.convert.QuboStructure(Q, C, x=None)[source]
QUBO Structure
obj x.T.dot(Q).dot(x) + C