def __init__(self, constraints):
    if (not isinstance(constraints, ConstraintSet)):
        constraints = ConstraintSet(constraints)
    substitutions = dict(constraints.substitutions)
    relconstraints = []
    self.origconstrs = []
    with NamedVariables('Relax'):
        self.relaxvars = VectorVariable(len(constraints), 'C')
    with SignomialsEnabled():
        for (i, constraint) in enumerate(constraints.flat()):
            self.origconstrs.append(constraint)
            relconstraints.append(constraint.relaxed(self.relaxvars[i]))
    ConstraintSet.__init__(self, {'relaxed constraints': relconstraints, 'minimum relaxation': (self.relaxvars >= 1)}, substitutions)
def __init__(self, constraints):
    if (not isinstance(constraints, ConstraintSet)):
        constraints = ConstraintSet(constraints)
    substitutions = dict(constraints.substitutions)
    relconstraints = []
    self.origconstrs = []
    with NamedVariables('Relax'):
        self.relaxvars = VectorVariable(len(constraints), 'C')
    with SignomialsEnabled():
        for (i, constraint) in enumerate(constraints.flat()):
            self.origconstrs.append(constraint)
            relconstraints.append(constraint.relaxed(self.relaxvars[i]))
    ConstraintSet.__init__(self, {'relaxed constraints': relconstraints, 'minimum relaxation': (self.relaxvars >= 1)}, substitutions)