'Separate the constraints by type.
Parameters
constraints : list
A list of constraints.
Returns
dict
A map of type key to an ordered set of constraints.'

@staticmethod
def filter_constraints(constraints):

    constr_map = {s.EQ: [], s.LEQ: [], s.SOC: [], s.SDP: [], s.EXP: [], s.BOOL: [], s.INT: []}
    for c in constraints:
        if isinstance(c, lo.LinEqConstr):
            constr_map[s.EQ].append(c)
        elif isinstance(c, lo.LinLeqConstr):
            constr_map[s.LEQ].append(c)
        elif isinstance(c, SOC):
            constr_map[s.SOC].append(c)
        elif isinstance(c, SDP):
            constr_map[s.SDP].append(c)
        elif isinstance(c, ExpCone):
            constr_map[s.EXP].append(c)
        elif isinstance(c, BoolConstr):
            constr_map[s.BOOL].append(c)
        elif isinstance(c, IntConstr):
            constr_map[s.INT].append(c)
    return constr_map
