Ejemplo n.º 1
0
 @Override
 public double get(int constraint, int variable) {
   if (values.size() < constraint) {
     OpenIntToDoubleHashMap constraintVals = values.get(constraint);
     if (constraintVals.containsKey(variable)) {
       return constraintVals.get(variable);
     }
   }
   return 0;
 }
Ejemplo n.º 2
0
 private Solution advancedStartToSolution(OpenIntToDoubleHashMap advancedStart) {
   double[] values = new double[basicLpSolver.getNumVars()];
   for (int i = 0; i < values.length; i++) {
     if (advancedStart.containsKey(i)) {
       values[i] = advancedStart.get(i);
     } else {
       return null;
     }
   }
   return new Solution(
       this.basicLpSolver.evaluateObjective(advancedStart),
       values,
       this.integralityTol,
       this.integerVariables);
 }