Program: 131758
Project: 131758
Buggy source:
public double[] solveModelParamSubproblemJOptimizeLogProb(final double[] weights,DmvBounds bounds,int c){
  final int numParams=weights.length;
  final DoubleMatrix1D weights1D=F1.make(weights);
  final DoubleMatrix2D zeros2D=F2.make(numParams,numParams);
  StrictlyConvexMultivariateRealFunction objectiveFunction=new StrictlyConvexMultivariateRealFunction(){
    public double value(    DoubleMatrix1D X){
      return X.zDotProduct(weights1D);
    }
    public DoubleMatrix1D gradient(    DoubleMatrix1D X){
      return weights1D;
    }
    public DoubleMatrix2D hessian(    DoubleMatrix1D X){
      return zeros2D;
    }
    public int getDim(){
      return numParams;
    }
  }
;
  ConvexMultivariateRealFunction[] inequalities=new ConvexMultivariateRealFunction[1 + 2 * numParams];
  inequalities[0]=new ConvexMultivariateRealFunction(){
    @Override public double value(    DoubleMatrix1D X){
      return X.aggregate(Functions.plus,Functions.exp) - 1.0;
    }
    @Override public DoubleMatrix1D gradient(    DoubleMatrix1D X){
      return X.copy().assign(Functions.exp);
    }
    @Override public DoubleMatrix2D hessian(    DoubleMatrix1D X){
      DoubleMatrix2D hessian=F2.make(numParams,numParams);
      for (int m=0; m < numParams; m++) {
        hessian.setQuick(m,m,Math.exp(X.getQuick(m)));
      }
      return hessian;
    }
    @Override public int getDim(){
      return numParams;
    }
  }
;
  for (int m=0; m < numParams; m++) {
    double[] factors=new double[numParams];
    factors[m]=-1;
    inequalities[1 + m]=new LinearMultivariateRealFunction(F1.make(factors),bounds.getLb(c,m));
  }
  for (int m=0; m < numParams; m++) {
    double[] factors=new double[numParams];
    factors[m]=1;
    inequalities[1 + numParams + m]=new LinearMultivariateRealFunction(F1.make(factors),-bounds.getUb(c,m));
  }
  OptimizationRequest or=new OptimizationRequest();
  or.f0=objectiveFunction;
  double[] initLogProbs=new double[numParams];
  for (int m=0; m < numParams; m++) {
    initLogProbs[m]=bounds.getLb(c,m);
  }
  or.initialPoint=F1.make(initLogProbs);
  or.fi=inequalities;
  CvxOptimizer opt=new CvxOptimizer();
  opt.setOptimizationRequest(or);
  OptimizationResponse response;
  try {
    response=opt.optimize();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  if (response.returnCode == OptimizationResponse.FAILED) {
    throw new IllegalStateException("String_Node_Str");
  }
  DoubleMatrix1D sol=response.solution;
  return sol.toArray();
}

Fixed version (ground truth):
public double[] solveModelParamSubproblemJOptimizeLogProb(final double[] weights,DmvBounds bounds,int c){
  final int numParams=weights.length;
  final DoubleMatrix1D weights1D=F1.make(weights);
  final DoubleMatrix2D zeros2D=F2.make(numParams,numParams);
  StrictlyConvexMultivariateRealFunction objectiveFunction=new StrictlyConvexMultivariateRealFunction(){
    public double value(    DoubleMatrix1D X){
      return X.zDotProduct(weights1D);
    }
    public DoubleMatrix1D gradient(    DoubleMatrix1D X){
      return weights1D;
    }
    public DoubleMatrix2D hessian(    DoubleMatrix1D X){
      return zeros2D;
    }
    public int getDim(){
      return numParams;
    }
  }
;
  ConvexMultivariateRealFunction[] inequalities=new ConvexMultivariateRealFunction[1 + 2 * numParams];
  inequalities[0]=new ConvexMultivariateRealFunction(){
    @Override public double value(    DoubleMatrix1D X){
      return X.aggregate(Functions.plus,Functions.exp) - 1.0;
    }
    @Override public DoubleMatrix1D gradient(    DoubleMatrix1D X){
      return X.copy().assign(Functions.exp);
    }
    @Override public DoubleMatrix2D hessian(    DoubleMatrix1D X){
      DoubleMatrix2D hessian=F2.make(numParams,numParams);
      for (int m=0; m < numParams; m++) {
        hessian.setQuick(m,m,Math.exp(X.getQuick(m)));
      }
      return hessian;
    }
    @Override public int getDim(){
      return numParams;
    }
  }
;
  for (int m=0; m < numParams; m++) {
    double[] factors=new double[numParams];
    factors[m]=-1;
    inequalities[1 + m]=new LinearMultivariateRealFunction(F1.make(factors),bounds.getLb(c,m) - 1e-13);
  }
  for (int m=0; m < numParams; m++) {
    double[] factors=new double[numParams];
    factors[m]=1;
    inequalities[1 + numParams + m]=new LinearMultivariateRealFunction(F1.make(factors),-(bounds.getUb(c,m) + 1e-13));
  }
  OptimizationRequest or=new OptimizationRequest();
  or.f0=objectiveFunction;
  double[] initLogProbs=new double[numParams];
  for (int m=0; m < numParams; m++) {
    initLogProbs[m]=bounds.getLb(c,m);
  }
  or.initialPoint=F1.make(initLogProbs);
  or.fi=inequalities;
  CvxOptimizer opt=new CvxOptimizer();
  opt.setOptimizationRequest(or);
  OptimizationResponse response;
  try {
    response=opt.optimize();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  if (response.returnCode == OptimizationResponse.FAILED) {
    throw new IllegalStateException("String_Node_Str");
  }
  DoubleMatrix1D sol=response.solution;
  return sol.toArray();
}