示例#1
0
 def accepts(self, problem):
     return (type(problem.objective) == Minimize
             and problem.objective.is_quadratic() and problem.is_dcp()
             and not convex_attributes(problem.variables()) and all(
                 type(c) == Zero or type(c) == NonPos
                 for c in problem.constraints)
             and are_args_affine(problem.constraints))
示例#2
0
 def accepts(problem):
     return (type(problem.objective) == Minimize
             and problem.objective.is_quadratic() and problem.is_dcp()
             and not convex_attributes(problem.variables()) and all(
                 type(c) in [Zero, NonPos, Equality, Inequality]
                 for c in problem.constraints)
             and are_args_affine(problem.constraints) and problem.is_dpp())
示例#3
0
 def accepts(self, problem):
     return (isinstance(problem, ParamConeProg)
             and (self.MIP_CAPABLE or not problem.is_mixed_integer())
             and not convex_attributes([problem.x])
             and (len(problem.constraints) > 0 or not self.REQUIRES_CONSTR)
             and all(type(c) in self.SUPPORTED_CONSTRAINTS for c in
                     problem.constraints))
示例#4
0
 def accepts(self, problem):
     return (type(problem.objective) == Minimize
             and (self.MIP_CAPABLE or not problem.is_mixed_integer())
             and is_stuffed_cone_objective(problem.objective)
             and not convex_attributes(problem.variables())
             and (len(problem.constraints) > 0 or not self.REQUIRES_CONSTR)
             and all(type(c) in self.SUPPORTED_CONSTRAINTS for c in
                     problem.constraints)
             and all(is_stuffed_cone_constraint(c) for c in
                     problem.constraints))
def accepts(problem):
    """
    Problems with quadratic, piecewise affine objectives,
    piecewise-linear constraints inequality constraints, and
    affine equality constraints are accepted by the reduction.
    """
    return (problem.objective.expr.is_qpwa() and not set(
        ['PSD', 'NSD']).intersection(convex_attributes(problem.variables()))
            and all((type(c) in (Inequality, NonPos) and c.expr.is_pwl()) or
                    (type(c) in (Equality, Zero) and are_args_affine([c]))
                    for c in problem.constraints))
示例#6
0
 def accepts(self, problem):
     """
     Problems with quadratic, piecewise affine objectives,
     piecewise-linear constraints inequality constraints, and
     affine equality constraints are accepted.
     """
     return (((type(problem.objective) == Minimize
               and problem.objective.expr.is_qpwa())
              or problem.objective.expr.is_affine())
             and not set(['PSD', 'NSD']).intersection(
                 convex_attributes(problem.variables())) and all(
                     (type(c) == NonPos and c.args[0].is_pwl()) or
                     (type(c) == Zero and are_args_affine([c]))
                     for c in problem.constraints))
示例#7
0
 def accepts(self, problem):
     return (type(problem.objective) == Minimize
             and problem.objective.expr.is_affine()
             and not convex_attributes(problem.variables())
             and are_args_affine(problem.constraints))