Grabs the concretized result so we can add the constraint ourselves.
184134
def _grab_concretization_results(cls, state):
        
        # only grab ones that match the constrained addrs
        if cls._should_add_constraints(state):
            addr = state.inspect.address_concretization_expr
            result = state.inspect.address_concretization_result
            if result is None:
                l.warning("addr concretization result is None")
                return
            state.preconstrainer.address_concretization.append((addr, result))
1328552
public function addConstraints()
    {
        $localValue = $this->farParent[$this->localKey];

        $this->performJoin();

        if (static::$constraints) {
            $this->query->where($this->getQualifiedFirstKeyName(), '=', $localValue);
        }
    }
957289
OrderedHashSet getDependentConstraints(int colIndex) {

        OrderedHashSet set = new OrderedHashSet();

        for (int i = 0, size = constraintList.length; i < size; i++) {
            Constraint c = constraintList[i];

            if (c.hasColumnOnly(colIndex)) {
                set.add(c);
            }
        }

        return set;
    }
1257767
public static void postImplies(ReconfigurationProblem rp, BoolVar b1, Constraint c2) {
        Model s = rp.getModel();
        BoolVar bC2 = s.boolVar(rp.makeVarLabel(c2.toString(), " satisfied"));
        c2.reifyWith(bC2);

        BoolVar notB1 = b1.not();
        s.post(rp.getModel().arithm(b1, "!=", notB1));

        s.post(rp.getModel().or(notB1, bC2));
    }
596301
private void evaluateConstraints(DoubleSolution solution) {
    double [] constraint = new double[this.getNumberOfConstraints()];
    double[] x = new double[getNumberOfVariables()] ;

    for (int i = 0; i < getNumberOfVariables(); i++) {
      x[i] = solution.getVariableValue(i) ;
    }

    double x1, x2, x3, x4;
    int var=0;
    int con=0;

    // restricciones de relaciÃƒÂ³n de forma en las paredes b/t
    for (int gr=0; gr<numberOfGroupElements_;gr++){

      var+=Groups_[gr][VARIABLES];
      con+=Groups_[gr][CONSTRAINT];

      if (Groups_[gr][SHAPE]==CIRCLE){
        x1=x[var-1]; // diameter
      }
      else if (Groups_[gr][SHAPE]==HOLE_CIRCLE){
        x1=x[var-2]; // diameter
        x2=x[var-1]; // tickness plate

        double ratio=x1/x2;
        if(ratio<x2/x1) ratio=x2/x1;
        constraint[con-1]=-ratio+Groups_[gr][RATIO_YZ]; // relaciÃƒÂ³n entre altura y base
      }
      else if (Groups_[gr][SHAPE]==RECTANGLE){
        x1=x[var-2]; // higth (y axis)
        x2=x[var-1]; // witdth (z axis)

        double ratio = x1/x2;
        constraint[con-2]=+ratio-Groups_[gr][RATIO_YZ]*0.75; // relaciÃƒÂ³n entre altura y base maxima
        constraint[con-1]=-ratio+Groups_[gr][RATIO_YZ]*1.5; // relaciÃƒÂ³n entre altura y base minima

      }

      else if (Groups_[gr][SHAPE]==HOLE_RECTANGLE){
        x1=x[var-4]; // height (y axis)
        x2=x[var-3]; // width (z axis)
        x3=x[var-2]; // tickness along Y axis => tickness of width  plate
        x4=x[var-1]; // tickness along Z axis => tickness of heigth plate

        double ratio=x1/x2;
        constraint[con-4]=+ratio-Groups_[gr][RATIO_YZ]*0.75; // relaciÃƒÂ³n entre altura y base maxima
        constraint[con-3]=-ratio+Groups_[gr][RATIO_YZ]*1.25; // relaciÃƒÂ³n entre altura y base minima

        double tb1=-x3*15+x1;
        double tb2=+x3*30-x1;
        double ta1=-x4*10+x2;
        double ta2=+x4*20-x2;
        //double ta2=-x2/x4+27;//0.3*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS])); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        constraint[con-2]=Math.min(tb1, tb2);//-x1/x3+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        constraint[con-1]=Math.min(ta1, ta2);//-x2/x4+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados

      }

      else if (Groups_[gr][SHAPE]==I_SINGLE){
        x1=x[var-4]; // height (y axis)
        x2=x[var-3]; // width (Z axis)
        x3=x[var-2]; // tickness along Y axis => tickness of width  plate
        x4=x[var-1]; // tickness along Z axis => tickness of heigth plate

        double ratio=x1/x2;
        constraint[con-4]=+ratio-Groups_[gr][RATIO_YZ]*0.75; // relaciÃƒÂ³n entre altura y base maxima
        constraint[con-3]=-ratio+Groups_[gr][RATIO_YZ]*1.25; // relaciÃƒÂ³n entre altura y base minima

        double tb1=-x3*15+x1;
        double tb2=+x3*30-x1;
        double ta1=-x4*10+x2;
        double ta2=+x4*20-x2;

        //double tb1=-x3*20+x1;
        //double tb2=-x1/x3+35;//0.6*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS])); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        //double ta1=-x4*15+x2;
        //double ta2=-x2/x4+27;//0.3*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS])); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        constraint[con-2]=Math.min(tb1, tb2);//-x1/x3+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        constraint[con-1]=Math.min(ta1, ta2);//-x2/x4+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados

      }

      else if (Groups_[gr][SHAPE]==I_DOUBLE){
        x1=x[var-4]; // height (y axis)
        x2=x[var-3]; // width (Z axis)
        x3=x[var-2]; // tickness along Y axis => tickness of width  plate
        x4=x[var-1]; // tickness along Z axis => tickness of heigth plate
        double ratio=x1/x2;
        constraint[con-4]=-ratio+Groups_[gr][RATIO_YZ]; // relaciÃƒÂ³n entre altura y base maxima
        constraint[con-3]=+ratio-Groups_[gr][RATIO_YZ]*0.85; // /2.0 relaciÃƒÂ³n entre altura y base minima
        constraint[con-2]=-x1/x3+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS])); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        constraint[con-1]=-x2/x4+0.35*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS_CUT]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
      }
      else if (Groups_[gr][SHAPE]==H_SINGLE){
        x1=x[var-4]; // height (y axis)
        x2=x[var-3]; // width (Z axis)
        x3=x[var-2]; // tickness along Y axis => tickness of width  plate
        x4=x[var-1]; // tickness along Z axis => tickness of heigth plate
        double ratio=x1/x2;
        constraint[con-4]=-ratio+Groups_[gr][RATIO_YZ]*0.85; // /2.0 relaciÃƒÂ³n entre altura y base maxima
        constraint[con-3]=+ratio-Groups_[gr][RATIO_YZ]; // relaciÃƒÂ³n entre altura y base minima
        constraint[con-2]=-x1/x3+0.35*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS_CUT]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        constraint[con-1]=-x2/x4+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
      }
      else if (Groups_[gr][SHAPE]==H_DOUBLE){
        x1=x[var-4]; // height (y axis)
        x2=x[var-3]; // width (Z axis)
        x3=x[var-2]; // thickness along Y axis => thickness of width  plate
        x4=x[var-1]; // thickness along Z axis => thickness of heigth plate
        double ratio=x1/x2;
        constraint[con-4]=-ratio+Groups_[gr][RATIO_YZ]*0.1; // 2.0 relaciÃƒÂ³n entre altura y base maxima
        constraint[con-3]=+ratio-Groups_[gr][RATIO_YZ]; // relaciÃƒÂ³n entre altura y base minima
        constraint[con-2]=-x1/x3+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS_CUT]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        constraint[con-1]=-x2/x4+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
      }
      else if (Groups_[gr][SHAPE]==L_SINGLE){
        x1=x[var-4]; // height (y axis)
        x2=x[var-3]; // width (Z axis)
        x3=x[var-2]; // thickness along Y axis => thickness of width  plate
        x4=x[var-1]; // thickness along Z axis => thickness heigth plate
        double ratio=x1/x2;
        constraint[con-4]=-ratio+Groups_[gr][RATIO_YZ]; // ratio between height and base
        constraint[con-3]=+ratio-Groups_[gr][RATIO_YZ]; // relaciÃƒÂ³n entre altura y base minima
        constraint[con-2]=-x1/x3+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        constraint[con-1]=-x2/x4+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
      }
      else if (Groups_[gr][SHAPE]==L_DOUBLE){
        x1=x[var-4]; // height (y axis)
        x2=x[var-3]; // width (Z axis)
        x3=x[var-2]; // tickness along Y axis => tickness of width  plate
        x4=x[var-1]; // tickness along Z axis => tickness of heigth plate
        double ratio=x1/x2;
        constraint[con-4]=-ratio+Groups_[gr][RATIO_YZ]; // relaciÃƒÂ³n entre altura y base maxima
        constraint[con-3]=+ratio-Groups_[gr][RATIO_YZ]; // relaciÃƒÂ³n entre altura y base minima
        constraint[con-2]=-x1/x3+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        constraint[con-1]=-x2/x4+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
      }
      else if (Groups_[gr][SHAPE]==T_SINGLE){
        x1=x[var-4]; // height (y axis)
        x2=x[var-3]; // width (Z axis)
        x3=x[var-2]; // tickness along Y axis => tickness of width  plate
        x4=x[var-1]; // tickness along Z axis => tickness of heigth plate
        double ratio=x1/x2;
        constraint[con-4]=-ratio+Groups_[gr][RATIO_YZ]; // relaciÃƒÂ³n entre altura y base maxima
        constraint[con-3]=+ratio-Groups_[gr][RATIO_YZ]*0.9; // 2.0 relaciÃƒÂ³n entre altura y base minima
        constraint[con-2]=-x1/x3+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        constraint[con-1]=-x2/x4+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
      }
      else if (Groups_[gr][SHAPE]==T_DOUBLE){
        x1=x[var-4]; // height (y axis)
        x2=x[var-3]; // width (Z axis)
        x3=x[var-2]; // tickness along Y axis => tickness of width  plate
        x4=x[var-1]; // tickness along Z axis => tickness of heigth plate
        double ratio=x1/x2;
        constraint[con-4]=-ratio+Groups_[gr][RATIO_YZ]; // relaciÃƒÂ³n entre altura y base maxima
        constraint[con-3]=+ratio-Groups_[gr][RATIO_YZ]*0.9; // 2.0 relaciÃƒÂ³n entre altura y base minima
        constraint[con-2]=-x1/x3+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
        constraint[con-1]=-x2/x4+1.12*Math.sqrt(Groups_[gr][E_]/(Groups_[gr][STRESS]*2.0)); // relaciÃƒÂ³n entre espesor de la placa y altura de lados
      }
      else{
        System.out.println("Error in constraint: transverse section not considerated for: " + gr + " group") ;
      }
    } // next gr

/*
    // LONGITUD TOTAL DE LA VIGA
    double l=0;
    for(int ba=0; ba<numberOfElements_; ba++){
        l+=Element_[ba][2];
    }
*/

    // RESTRICCIONES POR TENSIÃ“N
    for(int hi=0; hi<numberOfWeigthHypothesis_; hi++){
      for(int gr=0; gr<numberOfGroupElements_; gr++){

        // RESTRICCIONES DEBIDO A LA TENSIÃƒÂ³N DE TRACCIÃƒÂ³N
        constraint[con]=(-StrainMax_[gr][hi]+Groups_[gr][STRESS]); // -StrainMax_[gr][hi]*1.001+Groups_[gr][STRESS]
        con += 1;

        //constraint[con]=(-StrainMax_[gr][hi]+Groups_[gr][STRESS]*0.50); // -StrainMax_[gr][hi]*1.001+Groups_[gr][STRESS]
        //con += 1;

        // RESTRICCIONES DEBIDO A LA TENSIÃƒÂ³N DE COMPRESIÃƒÂ³N
        constraint[con]=(+StrainMin_[gr][hi]-Groups_[gr][COMPRESSION]); // +StrainMin_[gr][hi]*0.999-Groups_[gr][COMPRESSION]
        con += 1;

        //constraint[con]=(+StrainMin_[gr][hi]+Groups_[gr][COMPRESSION]*0.50); // +StrainMin_[gr][hi]*0.999-Groups_[gr][COMPRESSION]
        //con += 1;

        // RESTRICCIONES DEBIDO A LA TENSIÃƒâ€œN DE CORTE
        constraint[con]=(-StrainCutMax_[gr][hi]+Groups_[gr][STRESS_CUT]); // -StrainCutMax_[gr][hi]*1.001+Groups_[gr][STRESS_CUT]
        con += 1;
      }
    }


    for(int hi=0; hi<numberOfWeigthHypothesis_; hi++){
      // constraint of node displacement structure
      double deltaN=0;
      for(int i=0;i<nodeCheck_.length;i++){
        double xn=DisplacementNodes_[numberOfLibertyDegree_ * (int)nodeCheck_[i][0]+aX_][hi];
        double yn=DisplacementNodes_[numberOfLibertyDegree_ * (int)nodeCheck_[i][0]+aY_][hi];
        double zn=DisplacementNodes_[numberOfLibertyDegree_ * (int)nodeCheck_[i][0]+aZ_][hi];
        deltaN= Math.sqrt(Math.pow(xn,2)+Math.pow(yn,2)+Math.pow(zn,2));
        constraint[con]= (-deltaN +nodeCheck_[i][1]);
        con+=1;
      }
    }

    //constraint[0]=Math.sqrt(Math.pow(x, 2)+Math.pow(y, 2)+Math.pow(z, 2))+0.005;
    //descenso mÃƒÂ¡ximo en un nudo
    //constraint[1]=StrainResidual_[0][hi];


    double total = 0.0;
    //int number = 0;
    for (int i = 0; i < this.getNumberOfConstraints(); i++)
      if (constraint[i]<0.0){
        total+=constraint[i];
        //number++;
      }
    overallConstraintViolationDegree.setAttribute(solution, total);
    //solution.setOverallConstraintViolationDegree(total);
    //solution.setNumberOfViolatedConstraint(number);

  }
976974
Constraint getLimitConstraint() {
        Constraint result = null;
        for (Constraint constraint : getConstraints()) {
            if (constraint.getConstraintType() == Constraint.LIMIT) {
                // We're assuming only one LIMIT constraint at the moment
                result = constraint;
                break;
            }
        }
        return result;
    }
309171
public boolean add(SatConstraintBuilder c) {
        if (this.builders.containsKey(c.getIdentifier())) {
            return false;
        }
        this.builders.put(c.getIdentifier(), c);
        return true;
    }
1217758
public ComplexDouble addi(double a, ComplexDouble result) {
    if (this == result) {
      r += a;
    } else {
      result.r = r + a;
      result.i = i;
    }
    return result;
  }
467941
public ComplexFloat addi(float a, ComplexFloat result) {
    if (this == result) {
      r += a;
    } else {
      result.r = r + a;
      result.i = i;
    }
    return result;
  }
178137
public ConcatVectorTableProto.ConcatVectorTable.Builder getProtoBuilder() {
        ConcatVectorTableProto.ConcatVectorTable.Builder b = ConcatVectorTableProto.ConcatVectorTable.newBuilder();
        for (int n : getDimensions()) {
            b.addDimensionSize(n);
        }
        for (int[] assignment : this) {
            b.addFactorTable(getAssignmentValue(assignment).get().getProtoBuilder());
        }
        return b;
    }
1122293
def add_constraints(self):
        
        if self._constraints:
            self._query.where(self._foreign_key, "=", self.get_parent_key())
851647
private double getConstraint(double x1, double x2)
   {
      double c1,c2,h;
      c1 = -x1*x1-x2*x2+1+0.1*Math.cos(16*Math.atan(x1/x2));
      c2 = (x1-0.5)*(x1-0.5)+(x2-0.5)*(x2-0.5)-0.5;
      if(c1>c2)
         h = (c1>0)?c1:0;
      else
         h = (c2>0)?c2:0;
      return h;
   }
680865
def _constrain(value, lb=0, ub=1):
    """"""
    if value < lb:
        return lb
    elif value > ub:
        return ub
    else:
        return value
325682
def concretize(self, **kwargs):
        
        return (self._read_file.concretize(**kwargs), self._write_file.concretize(**kwargs))
535258
private LNGVector<Variable> initializeConstraint(final EncodingResult result, final Variable[] vars) {
    result.reset();
    this.result = result;
    this.cardinalityInvars = new LNGVector<>(vars.length);
    final LNGVector<Variable> cardinalityOutvars = new LNGVector<>(vars.length);
    for (final Variable var : vars) {
      this.cardinalityInvars.push(var);
      cardinalityOutvars.push(this.result.newVariable());
    }
    return cardinalityOutvars;
  }
1027683
function(current) {
        var bounds,
            constrainedBounds;

        bounds = this.getBounds(current);

        constrainedBounds = this._applyBoundaryConstraints(bounds);

        return constrainedBounds;
    }
240905
public MethodInfo addDefaultConstructor() {
        MethodInfo mi = addConstructor(Modifiers.PUBLIC, null);
        CodeBuilder builder = new CodeBuilder(mi);
        builder.loadThis();
        builder.invokeSuperConstructor(null);
        builder.returnVoid();
        return mi;
    }