Program: 131740
Project: 131740
Buggy source:
public RelaxedDmvSolution solveRelaxation(double incumbentScore){
  try {
    double upperBound=-incumbentScore;
    Pair<Status,Double> pair=runDWAlgo(cplex,mp,upperBound);
    Status status=pair.get1();
    double lowerBound=pair.get2();
    double objective=-lowerBound;
    assert(!Double.isNaN(objective));
    if (tempDir != null) {
      cplex.exportModel(new File(tempDir,"String_Node_Str").getAbsolutePath());
    }
    log.info("String_Node_Str" + status);
    if (!(status == Status.Optimal || status == Status.Feasible)) {
      return new RelaxedDmvSolution(null,null,null,objective,status);
    }
    if (tempDir != null) {
      cplex.writeSolution(new File(tempDir,"String_Node_Str").getAbsolutePath());
    }
    log.info("String_Node_Str" + lowerBound);
    log.info(String.format("String_Node_Str",mp.lambdaVars.size(),mp.gammaVars.size()));
    optimalLogProbs=new double[idm.getNumConds()][];
    for (int i=0; i < mp.gammaVars.size(); i++) {
      GammaVar gv=mp.gammaVars.get(i);
      double gammaValue=cplex.getValue(gv.gammaVar);
      for (int c=0; c < idm.getNumConds(); c++) {
        int numParams=idm.getNumParams(c);
        if (optimalLogProbs[c] == null) {
          optimalLogProbs[c]=new double[numParams];
        }
        for (int m=0; m < numParams; m++) {
          optimalLogProbs[c][m]+=gammaValue * gv.logProbs[c][m];
        }
      }
    }
    for (int c=0; c < idm.getNumConds(); c++) {
      double[] probs=Vectors.getExp(optimalLogProbs[c]);
      if (!Utilities.lte(Vectors.sum(probs),1.0,1e-8)) {
        log.warn(String.format("String_Node_Str",c,Vectors.sum(probs)));
      }
    }
    double[][] fracRoots=new double[sentences.size()][];
    double[][][] fracParses=new double[sentences.size()][][];
    for (int s=0; s < sentences.size(); s++) {
      Sentence sentence=sentences.get(s);
      fracRoots[s]=new double[sentence.size()];
      fracParses[s]=new double[sentence.size()][sentence.size()];
    }
    for (    LambdaVar triple : mp.lambdaVars) {
      double frac=cplex.getValue(triple.lambdaVar);
      int s=triple.s;
      int[] parents=triple.parents;
      double[] fracRoot=fracRoots[s];
      double[][] fracParse=fracParses[s];
      for (int child=0; child < parents.length; child++) {
        int parent=parents[child];
        if (parent == WallDepTreeNode.WALL_POSITION) {
          fracRoot[child]+=frac;
        }
 else {
          fracParse[parent][child]+=frac;
        }
      }
    }
    return new RelaxedDmvSolution(Utilities.copyOf(optimalLogProbs),fracRoots,fracParses,objective,status);
  }
 catch (  IloException e) {
    if (e instanceof ilog.cplex.CpxException) {
      ilog.cplex.CpxException cpxe=(ilog.cplex.CpxException)e;
      System.err.println("String_Node_Str" + cpxe.getStatus());
      System.err.println("String_Node_Str" + cpxe.getMessage());
    }
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public RelaxedDmvSolution solveRelaxation(double incumbentScore){
  try {
    double upperBound=-incumbentScore;
    Pair<SimpleStatus,Double> pair=runDWAlgo(cplex,mp,upperBound);
    SimpleStatus status=pair.get1();
    double lowerBound=pair.get2();
    double objective=-lowerBound;
    assert(!Double.isNaN(objective));
    if (tempDir != null) {
      cplex.exportModel(new File(tempDir,"String_Node_Str").getAbsolutePath());
    }
    log.info("String_Node_Str" + status);
    if (!status.hasSolution()) {
      return new RelaxedDmvSolution(null,null,null,objective,status);
    }
    if (tempDir != null) {
      cplex.writeSolution(new File(tempDir,"String_Node_Str").getAbsolutePath());
    }
    log.info("String_Node_Str" + lowerBound);
    log.info(String.format("String_Node_Str",mp.lambdaVars.size(),mp.gammaVars.size()));
    optimalLogProbs=new double[idm.getNumConds()][];
    for (int i=0; i < mp.gammaVars.size(); i++) {
      GammaVar gv=mp.gammaVars.get(i);
      double gammaValue=cplex.getValue(gv.gammaVar);
      for (int c=0; c < idm.getNumConds(); c++) {
        int numParams=idm.getNumParams(c);
        if (optimalLogProbs[c] == null) {
          optimalLogProbs[c]=new double[numParams];
        }
        for (int m=0; m < numParams; m++) {
          optimalLogProbs[c][m]+=gammaValue * gv.logProbs[c][m];
        }
      }
    }
    for (int c=0; c < idm.getNumConds(); c++) {
      double[] probs=Vectors.getExp(optimalLogProbs[c]);
      if (!Utilities.lte(Vectors.sum(probs),1.0,1e-8)) {
        log.warn(String.format("String_Node_Str",c,Vectors.sum(probs)));
      }
    }
    double[][] fracRoots=new double[sentences.size()][];
    double[][][] fracParses=new double[sentences.size()][][];
    for (int s=0; s < sentences.size(); s++) {
      Sentence sentence=sentences.get(s);
      fracRoots[s]=new double[sentence.size()];
      fracParses[s]=new double[sentence.size()][sentence.size()];
    }
    for (    LambdaVar triple : mp.lambdaVars) {
      double frac=cplex.getValue(triple.lambdaVar);
      int s=triple.s;
      int[] parents=triple.parents;
      double[] fracRoot=fracRoots[s];
      double[][] fracParse=fracParses[s];
      for (int child=0; child < parents.length; child++) {
        int parent=parents[child];
        if (parent == WallDepTreeNode.WALL_POSITION) {
          fracRoot[child]+=frac;
        }
 else {
          fracParse[parent][child]+=frac;
        }
      }
    }
    return new RelaxedDmvSolution(Utilities.copyOf(optimalLogProbs),fracRoots,fracParses,objective,status);
  }
 catch (  IloException e) {
    if (e instanceof ilog.cplex.CpxException) {
      ilog.cplex.CpxException cpxe=(ilog.cplex.CpxException)e;
      System.err.println("String_Node_Str" + cpxe.getStatus());
      System.err.println("String_Node_Str" + cpxe.getMessage());
    }
    throw new RuntimeException(e);
  }
}