Program: 131684
Project: 131684
Buggy source:
protected void buildModel(IloCplex cplex,DmvSolution initFeasSol) throws IloException {
  this.bounds=new CptBounds(this.idm);
  mp=new MasterProblem();
  mp.lpMatrix=cplex.addLPMatrix("String_Node_Str");
  sto.init(cplex,mp.lpMatrix,idm,bounds);
  int numConds=idm.getNumConds();
  mp.objective=cplex.addMinimize();
  sto.createModelParamVars();
  int[][] totSupFreqCm=idm.getTotSupervisedFreqCm(corpus);
  for (int c=0; c < numConds; c++) {
    for (int m=0; m < idm.getNumParams(c); m++) {
      if (totSupFreqCm[c][m] != 0) {
        cplex.setLinearCoef(mp.objective,-totSupFreqCm[c][m],sto.modelParamVars[c][m]);
      }
    }
  }
  mp.objVars=new IloNumVar[numConds][];
  for (int c=0; c < numConds; c++) {
    int numParams=idm.getNumParams(c);
    mp.objVars[c]=new IloNumVar[numParams];
    for (int m=0; m < numParams; m++) {
      mp.objVars[c][m]=cplex.numVar(-Double.MAX_VALUE,Double.MAX_VALUE,String.format("String_Node_Str",c,m));
      cplex.setLinearCoef(mp.objective,-1.0,mp.objVars[c][m]);
    }
  }
  mp.couplConsLower=new IloRange[numConds][];
  mp.couplConsUpper=new IloRange[numConds][];
  for (int c=0; c < numConds; c++) {
    int numParams=idm.getNumParams(c);
    mp.couplConsLower[c]=new IloRange[numParams];
    mp.couplConsUpper[c]=new IloRange[numParams];
    for (int m=0; m < numParams; m++) {
      String name;
      IloNumVar slackVarLower=cplex.numVar(-Double.MAX_VALUE,0.0,String.format("String_Node_Str",c,m));
      name=String.format("String_Node_Str",c,m);
      double maxFreqCm=idm.getUnsupervisedMaxTotalFreqCm(c,m);
      IloNumExpr rhsLower=cplex.sum(slackVarLower,cplex.diff(cplex.prod(maxFreqCm,sto.modelParamVars[c][m]),mp.objVars[c][m]));
      mp.couplConsLower[c][m]=cplex.eq(maxFreqCm * bounds.getLb(Type.PARAM,c,m),rhsLower,name);
      IloNumVar slackVarUpper=cplex.numVar(-Double.MAX_VALUE,0.0,String.format("String_Node_Str",c,m));
      name=String.format("String_Node_Str",c,m);
      IloNumExpr rhsUpper=cplex.sum(cplex.prod(-1.0,mp.objVars[c][m]),slackVarUpper);
      mp.couplConsUpper[c][m]=cplex.eq(0.0,rhsUpper,name);
    }
  }
  for (int c=0; c < numConds; c++) {
    mp.lpMatrix.addRows(mp.couplConsLower[c]);
  }
  for (int c=0; c < numConds; c++) {
    mp.lpMatrix.addRows(mp.couplConsUpper[c]);
  }
  mp.lambdaSumCons=new IloRange[corpus.getNumUnlabeled()];
  mp.lambdaVars=new ArrayList<LambdaVar>();
  mp.lambdaVarSet=new HashSet<LambdaVar>();
  addFeasibleSolution(initFeasSol);
  sto.addModelParamConstraints();
}

Fixed version (ground truth):
protected void buildModel(IloCplex cplex,DmvSolution initFeasSol) throws IloException {
  this.bounds=new CptBounds(this.idm);
  mp=new MasterProblem();
  mp.lpMatrix=cplex.addLPMatrix("String_Node_Str");
  sto.init(cplex,mp.lpMatrix,idm,bounds);
  int numConds=idm.getNumConds();
  mp.objective=cplex.addMinimize();
  sto.createModelParamVars();
  int[][] totSupFreqCm=idm.getTotSupervisedFreqCm(corpus);
  for (int c=0; c < numConds; c++) {
    for (int m=0; m < idm.getNumParams(c); m++) {
      if (totSupFreqCm[c][m] != 0) {
        cplex.setLinearCoef(mp.objective,-totSupFreqCm[c][m],sto.modelParamVars[c][m]);
      }
    }
  }
  mp.objVars=new IloNumVar[numConds][];
  for (int c=0; c < numConds; c++) {
    int numParams=idm.getNumParams(c);
    mp.objVars[c]=new IloNumVar[numParams];
    for (int m=0; m < numParams; m++) {
      mp.objVars[c][m]=cplex.numVar(-Double.MAX_VALUE,Double.MAX_VALUE,String.format("String_Node_Str",c,m));
      cplex.setLinearCoef(mp.objective,-1.0,mp.objVars[c][m]);
    }
  }
  mp.couplConsLower=new IloRange[numConds][];
  mp.couplConsUpper=new IloRange[numConds][];
  for (int c=0; c < numConds; c++) {
    int numParams=idm.getNumParams(c);
    mp.couplConsLower[c]=new IloRange[numParams];
    mp.couplConsUpper[c]=new IloRange[numParams];
    for (int m=0; m < numParams; m++) {
      String name;
      IloNumVar slackVarLower=cplex.numVar(-Double.MAX_VALUE,0.0,String.format("String_Node_Str",c,m));
      name=String.format("String_Node_Str",c,m);
      double maxFreqCm=idm.getTotUnsupervisedMaxFreqCm(c,m);
      IloNumExpr rhsLower=cplex.sum(slackVarLower,cplex.diff(cplex.prod(maxFreqCm,sto.modelParamVars[c][m]),mp.objVars[c][m]));
      mp.couplConsLower[c][m]=cplex.eq(maxFreqCm * bounds.getLb(Type.PARAM,c,m),rhsLower,name);
      IloNumVar slackVarUpper=cplex.numVar(-Double.MAX_VALUE,0.0,String.format("String_Node_Str",c,m));
      name=String.format("String_Node_Str",c,m);
      IloNumExpr rhsUpper=cplex.sum(cplex.prod(-1.0,mp.objVars[c][m]),slackVarUpper);
      mp.couplConsUpper[c][m]=cplex.eq(0.0,rhsUpper,name);
    }
  }
  for (int c=0; c < numConds; c++) {
    mp.lpMatrix.addRows(mp.couplConsLower[c]);
  }
  for (int c=0; c < numConds; c++) {
    mp.lpMatrix.addRows(mp.couplConsUpper[c]);
  }
  mp.lambdaSumCons=new IloRange[corpus.getNumUnlabeled()];
  mp.lambdaVars=new ArrayList<LambdaVar>();
  mp.lambdaVarSet=new HashSet<LambdaVar>();
  addFeasibleSolution(initFeasSol);
  sto.addModelParamConstraints();
}