Program: 131768
Project: 131768
Buggy source:
public void runDWAlgo(IloCplex cplex,MasterProblem mp) throws UnknownObjectException, IloException {
  DmvCkyParser parser=new DmvCkyParser();
  double prevObjVal=Double.POSITIVE_INFINITY;
  for (int cut=0; cut < numCutRounds; cut++) {
    while (true) {
      cplex.solve();
      log.trace("String_Node_Str" + cplex.getStatus());
      if (tempDir != null) {
        cplex.exportModel(new File(tempDir,"String_Node_Str").getAbsolutePath());
        cplex.writeSolution(new File(tempDir,"String_Node_Str").getAbsolutePath());
      }
      if (cplex.getStatus() == Status.Infeasible) {
        return;
      }
      double objVal=cplex.getObjValue();
      log.trace("String_Node_Str" + objVal);
      if (objVal > prevObjVal) {
        log.warn("String_Node_Str" + prevObjVal + "String_Node_Str"+ objVal);
      }
      prevObjVal=objVal;
      double[] pricesLower=cplex.getDuals(mp.couplMatrix,0,idm.getNumTotalParams());
      double[] pricesUpper=cplex.getDuals(mp.couplMatrix,idm.getNumTotalParams(),idm.getNumTotalParams());
      int numConds=idm.getNumConds();
      double[][] weights=new double[numConds][];
      int j=0;
      for (int c=0; c < numConds; c++) {
        int numParams=idm.getNumParams(c);
        weights[c]=new double[numParams];
        for (int m=0; m < numParams; m++) {
          weights[c][m]=(pricesLower[j] * bounds.getLb(c,m) + pricesUpper[j] * bounds.getUb(c,m));
          j++;
        }
      }
      DepProbMatrix dpm=idm.getDepProbMatrix(weights);
      double[] convexPrices=cplex.getDuals(mp.lambdaSumCons);
      int numPositiveRedCosts=0;
      for (int s=0; s < sentences.size(); s++) {
        Pair<DepTree,Double> pair=parser.parse(sentences.get(s),dpm);
        DepTree tree=pair.get1();
        double reducedCost=-pair.get2() - convexPrices[s];
        if (reducedCost < -5e-8) {
          if (addLambdaVar(cplex,s,tree)) {
            numPositiveRedCosts++;
          }
 else {
            log.warn(String.format("String_Node_Str",reducedCost,s,tree.getParents().toString()));
          }
        }
      }
      if (numPositiveRedCosts == 0) {
        break;
      }
    }
    if (cut == numCutRounds - 1) {
      break;
    }
    log.debug("String_Node_Str" + cut);
    double[][] params=new double[idm.getNumConds()][];
    for (int c=0; c < idm.getNumConds(); c++) {
      params[c]=cplex.getValues(mp.modelParamVars[c]);
    }
    for (int c=0; c < idm.getNumConds(); c++) {
      Vectors.exp(params[c]);
      if (Vectors.sum(params[c]) > MIN_SUM_FOR_CUT) {
        addSumToOneConstraint(cplex,c,params[c]);
      }
    }
  }
}

Fixed version (ground truth):
public void runDWAlgo(IloCplex cplex,MasterProblem mp) throws UnknownObjectException, IloException {
  DmvCkyParser parser=new DmvCkyParser();
  double prevObjVal=Double.POSITIVE_INFINITY;
  for (int cut=0; cut < numCutRounds; cut++) {
    while (true) {
      cplex.solve();
      log.trace("String_Node_Str" + cplex.getStatus());
      if (tempDir != null) {
        cplex.exportModel(new File(tempDir,"String_Node_Str").getAbsolutePath());
        cplex.writeSolution(new File(tempDir,"String_Node_Str").getAbsolutePath());
      }
      if (cplex.getStatus() == Status.Infeasible) {
        return;
      }
      double objVal=cplex.getObjValue();
      log.trace("String_Node_Str" + objVal);
      if (objVal > prevObjVal) {
        log.warn("String_Node_Str" + prevObjVal + "String_Node_Str"+ objVal);
      }
      prevObjVal=objVal;
      double[] pricesLower=cplex.getDuals(mp.couplMatrix,0,idm.getNumTotalParams());
      double[] pricesUpper=cplex.getDuals(mp.couplMatrix,idm.getNumTotalParams(),idm.getNumTotalParams());
      int numConds=idm.getNumConds();
      double[][] weights=new double[numConds][];
      int j=0;
      for (int c=0; c < numConds; c++) {
        int numParams=idm.getNumParams(c);
        weights[c]=new double[numParams];
        for (int m=0; m < numParams; m++) {
          weights[c][m]=(pricesLower[j] * bounds.getLb(c,m) + pricesUpper[j] * bounds.getUb(c,m));
          j++;
        }
      }
      DepProbMatrix dpm=idm.getDepProbMatrix(weights);
      double[] convexPrices=cplex.getDuals(mp.lambdaSumCons);
      int numPositiveRedCosts=0;
      for (int s=0; s < sentences.size(); s++) {
        Pair<DepTree,Double> pair=parser.parse(sentences.get(s),dpm);
        DepTree tree=pair.get1();
        double reducedCost=-pair.get2() - convexPrices[s];
        if (reducedCost < -5e-8) {
          if (addLambdaVar(cplex,s,tree)) {
            numPositiveRedCosts++;
          }
 else {
            log.warn(String.format("String_Node_Str",reducedCost,s,tree.getParents().toString()));
          }
        }
      }
      if (numPositiveRedCosts == 0) {
        break;
      }
 else {
        log.debug("String_Node_Str" + numPositiveRedCosts + "String_Node_Str");
      }
    }
    if (cut == numCutRounds - 1) {
      break;
    }
    double[][] params=new double[idm.getNumConds()][];
    for (int c=0; c < idm.getNumConds(); c++) {
      params[c]=cplex.getValues(mp.modelParamVars[c]);
    }
    int numNewStoConstraints=0;
    for (int c=0; c < idm.getNumConds(); c++) {
      Vectors.exp(params[c]);
      if (Vectors.sum(params[c]) > MIN_SUM_FOR_CUT) {
        numNewStoConstraints++;
        addSumToOneConstraint(cplex,c,params[c]);
      }
    }
    if (numNewStoConstraints == 0) {
      log.debug("String_Node_Str" + cut + "String_Node_Str");
      break;
    }
 else {
      log.debug("String_Node_Str" + numNewStoConstraints + "String_Node_Str"+ cut);
    }
  }
}