Program: 144027
Project: 144027
Buggy source:
private static void solveProbabilisticSoftLogicSubProblem(ConsensusAlternatingDirectionsMethodOfMultipliersSolver.SubProblem subProblem,CholeskyDecomposition[] subProblemCholeskyFactors){
  ProbabilisticSoftLogicSumFunctionTerm objectiveTerm=(ProbabilisticSoftLogicSumFunctionTerm)subProblem.objectiveTerm;
  subProblem.variables.set(subProblem.consensusVariables.sub(subProblem.multipliers.div(subProblem.penaltyParameter)));
  if (objectiveTerm.getLinearFunction().getValue(subProblem.variables) > 0) {
    if (objectiveTerm.getPower() == 1) {
      subProblem.variables.subInPlace(objectiveTerm.getLinearFunction().getA().mult(objectiveTerm.getWeight() / subProblem.penaltyParameter));
    }
 else     if (objectiveTerm.getPower() == 2) {
      double weight=objectiveTerm.getWeight();
      double constant=objectiveTerm.getLinearFunction().getB();
      subProblem.variables.multInPlace(subProblem.penaltyParameter).subInPlace(objectiveTerm.getLinearFunction().getA().mult(2 * weight * constant));
      if (subProblem.variables.size() == 1) {
        double coefficient=objectiveTerm.getLinearFunction().getA().get(0);
        subProblem.variables.divInPlace(2 * weight * coefficient* coefficient + subProblem.penaltyParameter);
      }
 else       if (subProblem.variables.size() == 2) {
        double coefficient0=objectiveTerm.getLinearFunction().getA().get(0);
        double coefficient1=objectiveTerm.getLinearFunction().getA().get(1);
        double a0=2 * weight * coefficient0* coefficient0 + subProblem.penaltyParameter;
        double b1=2 * weight * coefficient1* coefficient1 + subProblem.penaltyParameter;
        double a1b0=2 * weight * coefficient0* coefficient1;
        subProblem.variables.set(1,(subProblem.variables.get(1) - a1b0 * subProblem.variables.get(0) / a0) / (b1 - a1b0 * a1b0 / a0));
        subProblem.variables.set(0,(subProblem.variables.get(0) - a1b0 * subProblem.variables.get(1)) / a0);
      }
 else {
        try {
          subProblem.variables.set(subProblemCholeskyFactors[subProblem.subProblemIndex].solve(subProblem.variables));
        }
 catch (        NonSymmetricMatrixException|NonPositiveDefiniteMatrixException e) {
          System.err.println("String_Node_Str");
        }
      }
    }
 else {
      subProblem.variables.set(new NewtonSolver.Builder(new ConsensusAlternatingDirectionsMethodOfMultipliersSolver.SubProblemObjectiveFunction(objectiveTerm.getSubProblemObjectiveFunction(),subProblem.consensusVariables,subProblem.multipliers,subProblem.penaltyParameter),subProblem.variables).lineSearch(new NoLineSearch(1)).maximumNumberOfIterations(1).build().solve());
    }
    if (objectiveTerm.getLinearFunction().getValue(subProblem.variables) < 0) {
      subProblem.variables.set(objectiveTerm.getLinearFunction().projectToHyperplane(subProblem.consensusVariables));
    }
  }
}

Fixed version (ground truth):
private static void solveProbabilisticSoftLogicSubProblem(ConsensusAlternatingDirectionsMethodOfMultipliersSolver.SubProblem subProblem,Map<Integer,CholeskyDecomposition> subProblemCholeskyFactors){
  ProbabilisticSoftLogicSumFunctionTerm objectiveTerm=(ProbabilisticSoftLogicSumFunctionTerm)subProblem.objectiveTerm;
  subProblem.variables.set(subProblem.consensusVariables.sub(subProblem.multipliers.div(subProblem.penaltyParameter)));
  if (objectiveTerm.getLinearFunction().getValue(subProblem.variables) > 0) {
    if (objectiveTerm.getPower() == 1) {
      subProblem.variables.subInPlace(objectiveTerm.getLinearFunction().getA().mult(objectiveTerm.getWeight() / subProblem.penaltyParameter));
    }
 else     if (objectiveTerm.getPower() == 2) {
      double weight=objectiveTerm.getWeight();
      double constant=objectiveTerm.getLinearFunction().getB();
      subProblem.variables.multInPlace(subProblem.penaltyParameter).subInPlace(objectiveTerm.getLinearFunction().getA().mult(2 * weight * constant));
      if (subProblem.variables.size() == 1) {
        double coefficient=objectiveTerm.getLinearFunction().getA().get(0);
        subProblem.variables.divInPlace(2 * weight * coefficient* coefficient + subProblem.penaltyParameter);
      }
 else       if (subProblem.variables.size() == 2) {
        double coefficient0=objectiveTerm.getLinearFunction().getA().get(0);
        double coefficient1=objectiveTerm.getLinearFunction().getA().get(1);
        double a0=2 * weight * coefficient0* coefficient0 + subProblem.penaltyParameter;
        double b1=2 * weight * coefficient1* coefficient1 + subProblem.penaltyParameter;
        double a1b0=2 * weight * coefficient0* coefficient1;
        subProblem.variables.set(1,(subProblem.variables.get(1) - a1b0 * subProblem.variables.get(0) / a0) / (b1 - a1b0 * a1b0 / a0));
        subProblem.variables.set(0,(subProblem.variables.get(0) - a1b0 * subProblem.variables.get(1)) / a0);
      }
 else {
        try {
          subProblem.variables.set(subProblemCholeskyFactors.get(subProblem.subProblemIndex).solve(subProblem.variables));
        }
 catch (        NonSymmetricMatrixException|NonPositiveDefiniteMatrixException e) {
          System.err.println("String_Node_Str");
        }
      }
    }
 else {
      subProblem.variables.set(new NewtonSolver.Builder(new ConsensusAlternatingDirectionsMethodOfMultipliersSolver.SubProblemObjectiveFunction(objectiveTerm.getSubProblemObjectiveFunction(),subProblem.consensusVariables,subProblem.multipliers,subProblem.penaltyParameter),subProblem.variables).lineSearch(new NoLineSearch(1)).maximumNumberOfIterations(1).build().solve());
    }
    if (objectiveTerm.getLinearFunction().getValue(subProblem.variables) < 0) {
      subProblem.variables.set(objectiveTerm.getLinearFunction().projectToHyperplane(subProblem.consensusVariables));
    }
  }
}