Java Reference

Java Reference

MPSolver.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.1
4  *
5  * Do not make changes to this file unless you know what you are doing--modify
6  * the SWIG interface file instead.
7  * ----------------------------------------------------------------------------- */
8 
9 package com.google.ortools.linearsolver;
10 
11 import java.lang.reflect.*;
12 
17 public class MPSolver {
18  private transient long swigCPtr;
19  protected transient boolean swigCMemOwn;
20 
21  protected MPSolver(long cPtr, boolean cMemoryOwn) {
22  swigCMemOwn = cMemoryOwn;
23  swigCPtr = cPtr;
24  }
25 
26  protected static long getCPtr(MPSolver obj) {
27  return (obj == null) ? 0 : obj.swigCPtr;
28  }
29 
30  @SuppressWarnings("deprecation")
31  protected void finalize() {
32  delete();
33  }
34 
35  public synchronized void delete() {
36  if (swigCPtr != 0) {
37  if (swigCMemOwn) {
38  swigCMemOwn = false;
39  main_research_linear_solverJNI.delete_MPSolver(swigCPtr);
40  }
41  swigCPtr = 0;
42  }
43  }
44 
48  public MPVariable[] makeVarArray(int count, double lb, double ub, boolean integer) {
49  MPVariable[] array = new MPVariable[count];
50  for (int i = 0; i < count; ++i) {
51  array[i] = makeVar(lb, ub, integer, "");
52  }
53  return array;
54  }
55 
59  public MPVariable[] makeVarArray(int count, double lb, double ub, boolean integer,
60  String var_name) {
61  MPVariable[] array = new MPVariable[count];
62  for (int i = 0; i < count; ++i) {
63  array[i] = makeVar(lb, ub, integer, var_name + i);
64  }
65  return array;
66  }
67 
68  public MPVariable[] makeNumVarArray(int count, double lb, double ub) {
69  return makeVarArray(count, lb, ub, false);
70  }
71 
72  public MPVariable[] makeNumVarArray(int count, double lb, double ub, String var_name) {
73  return makeVarArray(count, lb, ub, false, var_name);
74  }
75 
76  public MPVariable[] makeIntVarArray(int count, double lb, double ub) {
77  return makeVarArray(count, lb, ub, true);
78  }
79 
80  public MPVariable[] makeIntVarArray(int count, double lb, double ub, String var_name) {
81  return makeVarArray(count, lb, ub, true, var_name);
82  }
83 
84  public MPVariable[] makeBoolVarArray(int count) {
85  return makeVarArray(count, 0.0, 1.0, true);
86  }
87 
88  public MPVariable[] makeBoolVarArray(int count, String var_name) {
89  return makeVarArray(count, 0.0, 1.0, true, var_name);
90  }
91 
95  public MPSolver(String name, MPSolver.OptimizationProblemType problem_type) {
96  this(main_research_linear_solverJNI.new_MPSolver(name, problem_type.swigValue()), true);
97  }
98 
103  public static boolean supportsProblemType(MPSolver.OptimizationProblemType problem_type) {
104  return main_research_linear_solverJNI.MPSolver_supportsProblemType(problem_type.swigValue());
105  }
106 
112  public void clear() {
113  main_research_linear_solverJNI.MPSolver_clear(swigCPtr, this);
114  }
115 
119  public int numVariables() {
120  return main_research_linear_solverJNI.MPSolver_numVariables(swigCPtr, this);
121  }
122 
127  public MPVariable[] variables() {
128  return main_research_linear_solverJNI.MPSolver_variables(swigCPtr, this);
129 }
130 
136  public MPVariable lookupVariableOrNull(String var_name) {
137  long cPtr = main_research_linear_solverJNI.MPSolver_lookupVariableOrNull(swigCPtr, this, var_name);
138  return (cPtr == 0) ? null : new MPVariable(cPtr, false);
139  }
140 
148  public MPVariable makeVar(double lb, double ub, boolean integer, String name) {
149  long cPtr = main_research_linear_solverJNI.MPSolver_makeVar(swigCPtr, this, lb, ub, integer, name);
150  return (cPtr == 0) ? null : new MPVariable(cPtr, false);
151  }
152 
156  public MPVariable makeNumVar(double lb, double ub, String name) {
157  long cPtr = main_research_linear_solverJNI.MPSolver_makeNumVar(swigCPtr, this, lb, ub, name);
158  return (cPtr == 0) ? null : new MPVariable(cPtr, false);
159  }
160 
164  public MPVariable makeIntVar(double lb, double ub, String name) {
165  long cPtr = main_research_linear_solverJNI.MPSolver_makeIntVar(swigCPtr, this, lb, ub, name);
166  return (cPtr == 0) ? null : new MPVariable(cPtr, false);
167  }
168 
172  public MPVariable makeBoolVar(String name) {
173  long cPtr = main_research_linear_solverJNI.MPSolver_makeBoolVar(swigCPtr, this, name);
174  return (cPtr == 0) ? null : new MPVariable(cPtr, false);
175  }
176 
180  public int numConstraints() {
181  return main_research_linear_solverJNI.MPSolver_numConstraints(swigCPtr, this);
182  }
183 
190  return main_research_linear_solverJNI.MPSolver_constraints(swigCPtr, this);
191 }
192 
200  public MPConstraint lookupConstraintOrNull(String constraint_name) {
201  long cPtr = main_research_linear_solverJNI.MPSolver_lookupConstraintOrNull(swigCPtr, this, constraint_name);
202  return (cPtr == 0) ? null : new MPConstraint(cPtr, false);
203  }
204 
213  public MPConstraint makeConstraint(double lb, double ub) {
214  long cPtr = main_research_linear_solverJNI.MPSolver_makeConstraint__SWIG_0(swigCPtr, this, lb, ub);
215  return (cPtr == 0) ? null : new MPConstraint(cPtr, false);
216  }
217 
222  long cPtr = main_research_linear_solverJNI.MPSolver_makeConstraint__SWIG_1(swigCPtr, this);
223  return (cPtr == 0) ? null : new MPConstraint(cPtr, false);
224  }
225 
229  public MPConstraint makeConstraint(double lb, double ub, String name) {
230  long cPtr = main_research_linear_solverJNI.MPSolver_makeConstraint__SWIG_2(swigCPtr, this, lb, ub, name);
231  return (cPtr == 0) ? null : new MPConstraint(cPtr, false);
232  }
233 
237  public MPConstraint makeConstraint(String name) {
238  long cPtr = main_research_linear_solverJNI.MPSolver_makeConstraint__SWIG_3(swigCPtr, this, name);
239  return (cPtr == 0) ? null : new MPConstraint(cPtr, false);
240  }
241 
246  long cPtr = main_research_linear_solverJNI.MPSolver_objective(swigCPtr, this);
247  return (cPtr == 0) ? null : new MPObjective(cPtr, false);
248  }
249 
254  return MPSolver.ResultStatus.swigToEnum(main_research_linear_solverJNI.MPSolver_solve__SWIG_0(swigCPtr, this));
255  }
256 
261  return MPSolver.ResultStatus.swigToEnum(main_research_linear_solverJNI.MPSolver_solve__SWIG_1(swigCPtr, this, MPSolverParameters.getCPtr(param), param));
262  }
263 
270  public double[] computeConstraintActivities() {
271  return main_research_linear_solverJNI.MPSolver_computeConstraintActivities(swigCPtr, this);
272 }
273 
292  public boolean verifySolution(double tolerance, boolean log_errors) {
293  return main_research_linear_solverJNI.MPSolver_verifySolution(swigCPtr, this, tolerance, log_errors);
294  }
295 
304  public void reset() {
305  main_research_linear_solverJNI.MPSolver_reset(swigCPtr, this);
306  }
307 
316  public boolean interruptSolve() {
317  return main_research_linear_solverJNI.MPSolver_interruptSolve(swigCPtr, this);
318  }
319 
326  public boolean setSolverSpecificParametersAsString(String parameters) {
327  return main_research_linear_solverJNI.MPSolver_setSolverSpecificParametersAsString(swigCPtr, this, parameters);
328  }
329 
335  public static double infinity() {
336  return main_research_linear_solverJNI.MPSolver_infinity();
337  }
338 
342  public void enableOutput() {
343  main_research_linear_solverJNI.MPSolver_enableOutput(swigCPtr, this);
344  }
345 
349  public void suppressOutput() {
350  main_research_linear_solverJNI.MPSolver_suppressOutput(swigCPtr, this);
351  }
352 
356  public long iterations() {
357  return main_research_linear_solverJNI.MPSolver_iterations(swigCPtr, this);
358  }
359 
365  public long nodes() {
366  return main_research_linear_solverJNI.MPSolver_nodes(swigCPtr, this);
367  }
368 
393  public double computeExactConditionNumber() {
394  return main_research_linear_solverJNI.MPSolver_computeExactConditionNumber(swigCPtr, this);
395  }
396 
397  public void setTimeLimit(long time_limit_milliseconds) {
398  main_research_linear_solverJNI.MPSolver_setTimeLimit(swigCPtr, this, time_limit_milliseconds);
399  }
400 
401  public long wallTime() {
402  return main_research_linear_solverJNI.MPSolver_wallTime(swigCPtr, this);
403  }
404 
410  return main_research_linear_solverJNI.MPSolver_loadModelFromProto(swigCPtr, this, input_model.toByteArray());
411  }
412 
414  return main_research_linear_solverJNI.MPSolver_loadModelFromProtoWithUniqueNamesOrDie(swigCPtr, this, input_model.toByteArray());
415  }
416 
421  byte[] buf = main_research_linear_solverJNI.MPSolver_exportModelToProto(swigCPtr, this);
422  if (buf == null || buf.length == 0) {
423  return null;
424  }
425  try {
427  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
428  throw new RuntimeException(
429  "Unable to parse com.google.ortools.linearsolver.MPModelProto protocol message.");
430  }
431 }
432 
437  byte[] buf = main_research_linear_solverJNI.MPSolver_createSolutionResponseProto(swigCPtr, this);
438  if (buf == null || buf.length == 0) {
439  return null;
440  }
441  try {
443  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
444  throw new RuntimeException(
445  "Unable to parse com.google.ortools.linearsolver.MPSolutionResponse protocol message.");
446  }
447 }
448 
481  return main_research_linear_solverJNI.MPSolver_loadSolutionFromProto(swigCPtr, this, response.toByteArray());
482  }
483 
488  byte[] buf = main_research_linear_solverJNI.MPSolver_solveWithProto(model_request.toByteArray());
489  if (buf == null || buf.length == 0) {
490  return null;
491  }
492  try {
494  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
495  throw new RuntimeException(
496  "Unable to parse com.google.ortools.linearsolver.MPSolutionResponse protocol message.");
497  }
498 }
499 
504  return main_research_linear_solverJNI.MPSolver_exportModelAsLpFormat__SWIG_0(swigCPtr, this, MPModelExportOptions.getCPtr(options), options);
505  }
506 
510  public String exportModelAsLpFormat() {
511  return main_research_linear_solverJNI.MPSolver_exportModelAsLpFormat__SWIG_1(swigCPtr, this);
512  }
513 
518  return main_research_linear_solverJNI.MPSolver_exportModelAsMpsFormat__SWIG_0(swigCPtr, this, MPModelExportOptions.getCPtr(options), options);
519  }
520 
524  public String exportModelAsMpsFormat() {
525  return main_research_linear_solverJNI.MPSolver_exportModelAsMpsFormat__SWIG_1(swigCPtr, this);
526  }
527 
541  public void setHint(MPVariable[] variables, double[] values) {
542  main_research_linear_solverJNI.MPSolver_setHint(swigCPtr, this, variables, values);
543  }
544 
548  public boolean setNumThreads(int num_theads) {
549  return main_research_linear_solverJNI.MPSolver_setNumThreads(swigCPtr, this, num_theads);
550  }
551 
562  CLP_LINEAR_PROGRAMMING(main_research_linear_solverJNI.MPSolver_CLP_LINEAR_PROGRAMMING_get()),
566  GLOP_LINEAR_PROGRAMMING(main_research_linear_solverJNI.MPSolver_GLOP_LINEAR_PROGRAMMING_get()),
570  CBC_MIXED_INTEGER_PROGRAMMING(main_research_linear_solverJNI.MPSolver_CBC_MIXED_INTEGER_PROGRAMMING_get()),
574  BOP_INTEGER_PROGRAMMING(main_research_linear_solverJNI.MPSolver_BOP_INTEGER_PROGRAMMING_get()),
578  SAT_INTEGER_PROGRAMMING(main_research_linear_solverJNI.MPSolver_SAT_INTEGER_PROGRAMMING_get());
579 
580  public final int swigValue() {
581  return swigValue;
582  }
583 
584  public static OptimizationProblemType swigToEnum(int swigValue) {
585  OptimizationProblemType[] swigValues = OptimizationProblemType.class.getEnumConstants();
586  if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
587  return swigValues[swigValue];
588  for (OptimizationProblemType swigEnum : swigValues)
589  if (swigEnum.swigValue == swigValue)
590  return swigEnum;
591  throw new IllegalArgumentException("No enum " + OptimizationProblemType.class + " with value " + swigValue);
592  }
593 
594  @SuppressWarnings("unused")
595  private OptimizationProblemType() {
596  this.swigValue = SwigNext.next++;
597  }
598 
599  @SuppressWarnings("unused")
600  private OptimizationProblemType(int swigValue) {
601  this.swigValue = swigValue;
602  SwigNext.next = swigValue+1;
603  }
604 
605  @SuppressWarnings("unused")
606  private OptimizationProblemType(OptimizationProblemType swigEnum) {
607  this.swigValue = swigEnum.swigValue;
608  SwigNext.next = this.swigValue+1;
609  }
610 
611  private final int swigValue;
612 
613  private static class SwigNext {
614  private static int next = 0;
615  }
616  }
617 
624  public enum ResultStatus {
648  NOT_SOLVED(main_research_linear_solverJNI.MPSolver_NOT_SOLVED_get());
649 
650  public final int swigValue() {
651  return swigValue;
652  }
653 
654  public static ResultStatus swigToEnum(int swigValue) {
655  ResultStatus[] swigValues = ResultStatus.class.getEnumConstants();
656  if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
657  return swigValues[swigValue];
658  for (ResultStatus swigEnum : swigValues)
659  if (swigEnum.swigValue == swigValue)
660  return swigEnum;
661  throw new IllegalArgumentException("No enum " + ResultStatus.class + " with value " + swigValue);
662  }
663 
664  @SuppressWarnings("unused")
665  private ResultStatus() {
666  this.swigValue = SwigNext.next++;
667  }
668 
669  @SuppressWarnings("unused")
670  private ResultStatus(int swigValue) {
671  this.swigValue = swigValue;
672  SwigNext.next = swigValue+1;
673  }
674 
675  @SuppressWarnings("unused")
676  private ResultStatus(ResultStatus swigEnum) {
677  this.swigValue = swigEnum.swigValue;
678  SwigNext.next = this.swigValue+1;
679  }
680 
681  private final int swigValue;
682 
683  private static class SwigNext {
684  private static int next = 0;
685  }
686  }
687 
692  public enum BasisStatus {
693  FREE(main_research_linear_solverJNI.MPSolver_FREE_get()),
698 
699  public final int swigValue() {
700  return swigValue;
701  }
702 
703  public static BasisStatus swigToEnum(int swigValue) {
704  BasisStatus[] swigValues = BasisStatus.class.getEnumConstants();
705  if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
706  return swigValues[swigValue];
707  for (BasisStatus swigEnum : swigValues)
708  if (swigEnum.swigValue == swigValue)
709  return swigEnum;
710  throw new IllegalArgumentException("No enum " + BasisStatus.class + " with value " + swigValue);
711  }
712 
713  @SuppressWarnings("unused")
714  private BasisStatus() {
715  this.swigValue = SwigNext.next++;
716  }
717 
718  @SuppressWarnings("unused")
719  private BasisStatus(int swigValue) {
720  this.swigValue = swigValue;
721  SwigNext.next = swigValue+1;
722  }
723 
724  @SuppressWarnings("unused")
725  private BasisStatus(BasisStatus swigEnum) {
726  this.swigValue = swigEnum.swigValue;
727  SwigNext.next = this.swigValue+1;
728  }
729 
730  private final int swigValue;
731 
732  private static class SwigNext {
733  private static int next = 0;
734  }
735  }
736 
737 }
boolean interruptSolve()
Interrupts the Solve() execution to terminate processing if possible.
Definition: MPSolver.java:316
final int swigValue()
Definition: MPSolver.java:699
MPObjective objective()
Returns the mutable objective object.
Definition: MPSolver.java:245
MPVariable makeVar(double lb, double ub, boolean integer, String name)
Creates a variable with the given bounds, integrality requirement and name.
Definition: MPSolver.java:148
void enableOutput()
Enables solver logging.
Definition: MPSolver.java:342
UNBOUNDED
proven unbounded.
Definition: MPSolver.java:640
FIXED_VALUE
Definition: MPSolver.java:696
MPVariable lookupVariableOrNull(String var_name)
Looks up a variable by name, and returns nullptr if it does not exist.
Definition: MPSolver.java:136
String exportModelAsLpFormat()
Export the loaded model in LP format.
Definition: MPSolver.java:510
com.google.ortools.linearsolver.MPSolutionResponse createSolutionResponseProto()
Fills the solution found to a response proto and returns it.
Definition: MPSolver.java:436
MPVariable[] makeVarArray(int count, double lb, double ub, boolean integer)
Creates and returns an array of variables.
Definition: MPSolver.java:48
This class stores parameter settings for LP and MIP solvers.
GLOP_LINEAR_PROGRAMMING
Linear Programming solver using GLOP (Recommended solver).
Definition: MPSolver.java:566
Protobuf type.
CLP_LINEAR_PROGRAMMING
Linear Programming solver using Coin CBC.
Definition: MPSolver.java:562
String loadModelFromProto(com.google.ortools.linearsolver.MPModelProto input_model)
Loads a model and returns the error message, which will be empty iff the model is valid.
Definition: MPSolver.java:409
void setHint(MPVariable[] variables, double[] values)
Sets a hint for solution.
Definition: MPSolver.java:541
boolean setSolverSpecificParametersAsString(String parameters)
Advanced usage: pass solver specific parameters in text format.
Definition: MPSolver.java:326
static com.google.ortools.linearsolver.MPSolutionResponse solveWithProto(com.google.ortools.linearsolver.MPModelRequest model_request)
Solves the given model proto and returns a response proto.
Definition: MPSolver.java:487
AT_UPPER_BOUND
Definition: MPSolver.java:695
MPVariable makeNumVar(double lb, double ub, String name)
Creates a continuous variable.
Definition: MPSolver.java:156
MPConstraint makeConstraint(double lb, double ub, String name)
Creates a named constraint with given bounds.
Definition: MPSolver.java:229
INFEASIBLE
proven infeasible.
Definition: MPSolver.java:636
MPConstraint[] constraints()
Returns the array of constraints handled by the MPSolver.
Definition: MPSolver.java:189
Advanced usage: possible basis status values for a variable and the slack variable of a linear const...
Definition: MPSolver.java:692
static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(java.nio.ByteBuffer data)
static BasisStatus swigToEnum(int swigValue)
Definition: MPSolver.java:703
FEASIBLE
feasible, or stopped by limit.
Definition: MPSolver.java:632
MPVariable[] makeIntVarArray(int count, double lb, double ub)
Definition: MPSolver.java:76
boolean verifySolution(double tolerance, boolean log_errors)
Advanced usage: Verifies the correctness of the solution.
Definition: MPSolver.java:292
BOP_INTEGER_PROGRAMMING
Linear Boolean Programming Solver.
Definition: MPSolver.java:574
MPSolver(long cPtr, boolean cMemoryOwn)
Definition: MPSolver.java:21
MPVariable[] makeNumVarArray(int count, double lb, double ub)
Definition: MPSolver.java:68
double[] computeConstraintActivities()
Advanced usage: compute the "activities" of all constraints, which are the sums of their linear term...
Definition: MPSolver.java:270
void reset()
Advanced usage: resets extracted model to solve from scratch.
Definition: MPSolver.java:304
FREE
Definition: MPSolver.java:693
NOT_SOLVED
not been solved yet.
Definition: MPSolver.java:648
The status of solving the problem.
Definition: MPSolver.java:624
static double infinity()
Infinity.
Definition: MPSolver.java:335
String exportModelAsMpsFormat()
Export the loaded model in MPS format.
Definition: MPSolver.java:524
MPVariable makeBoolVar(String name)
Creates a boolean variable.
Definition: MPSolver.java:172
BASIC
Definition: MPSolver.java:697
boolean setNumThreads(int num_theads)
Sets the number of threads to be used by the solver.
Definition: MPSolver.java:548
The class for constraints of a Mathematical Programming (MP) model.
MPConstraint makeConstraint(double lb, double ub)
Creates a linear constraint with given bounds.
Definition: MPSolver.java:213
void setTimeLimit(long time_limit_milliseconds)
Definition: MPSolver.java:397
long wallTime()
Definition: MPSolver.java:401
long iterations()
Returns the number of simplex iterations.
Definition: MPSolver.java:356
static OptimizationProblemType swigToEnum(int swigValue)
Definition: MPSolver.java:584
MPConstraint makeConstraint()
Creates a constraint with -infinity and +infinity bounds.
Definition: MPSolver.java:221
AT_LOWER_BOUND
Definition: MPSolver.java:694
MPVariable[] makeNumVarArray(int count, double lb, double ub, String var_name)
Definition: MPSolver.java:72
String loadModelFromProtoWithUniqueNamesOrDie(com.google.ortools.linearsolver.MPModelProto input_model)
Definition: MPSolver.java:413
static ResultStatus swigToEnum(int swigValue)
Definition: MPSolver.java:654
final int swigValue()
Definition: MPSolver.java:580
MPVariable makeIntVar(double lb, double ub, String name)
Creates an integer variable.
Definition: MPSolver.java:164
The type of problems (LP or MIP) that will be solved and the underlying solver (GLOP,...
Definition: MPSolver.java:558
CBC_MIXED_INTEGER_PROGRAMMING
Mixed integer Programming Solver using Coin CBC.
Definition: MPSolver.java:570
OPTIMAL
optimal.
Definition: MPSolver.java:628
long nodes()
Returns the number of branch-and-bound nodes evaluated during the solve.
Definition: MPSolver.java:365
void clear()
Clears the objective (including the optimization direction), all variables and constraints.
Definition: MPSolver.java:112
String exportModelAsLpFormat(MPModelExportOptions options)
Export the loaded model in LP format.
Definition: MPSolver.java:503
static boolean supportsProblemType(MPSolver.OptimizationProblemType problem_type)
Whether the given problem type is supported (this will depend on the targets that you linked).
Definition: MPSolver.java:103
MPVariable[] makeBoolVarArray(int count)
Definition: MPSolver.java:84
void suppressOutput()
Suppresses solver logging.
Definition: MPSolver.java:349
A class to express a linear objective.
MPVariable[] variables()
Returns the array of variables handled by the MPSolver.
Definition: MPSolver.java:127
MPVariable[] makeBoolVarArray(int count, String var_name)
Definition: MPSolver.java:88
com.google.ortools.linearsolver.MPModelProto exportModelToProto()
Export the loaded model to proto and returns it.
Definition: MPSolver.java:420
MPSolver(String name, MPSolver.OptimizationProblemType problem_type)
Create a solver with the given name and underlying solver backend.
Definition: MPSolver.java:95
String exportModelAsMpsFormat(MPModelExportOptions options)
Export the loaded model in MPS format.
Definition: MPSolver.java:517
MPConstraint makeConstraint(String name)
Creates a named constraint with -infinity and +infinity bounds.
Definition: MPSolver.java:237
int numVariables()
Returns the number of variables.
Definition: MPSolver.java:119
The class for variables of a Mathematical Programming (MP) model.
Definition: MPVariable.java:16
static com.google.ortools.linearsolver.MPModelProto parseFrom(java.nio.ByteBuffer data)
MPVariable[] makeVarArray(int count, double lb, double ub, boolean integer, String var_name)
Creates and returns an array of named variables.
Definition: MPSolver.java:59
MPVariable[] makeIntVarArray(int count, double lb, double ub, String var_name)
Definition: MPSolver.java:80
final int swigValue()
Definition: MPSolver.java:650
boolean loadSolutionFromProto(com.google.ortools.linearsolver.MPSolutionResponse response)
Load a solution encoded in a protocol buffer onto this solver for easy access via the MPSolver inter...
Definition: MPSolver.java:480
MPSolver.ResultStatus solve(MPSolverParameters param)
Solves the problem using the specified parameter values.
Definition: MPSolver.java:260
Export options.
MPConstraint lookupConstraintOrNull(String constraint_name)
Looks up a constraint by name, and returns nullptr if it does not exist.
Definition: MPSolver.java:200
double computeExactConditionNumber()
Advanced usage: computes the exact condition number of the current scaled basis: L1norm(B) * L1norm(...
Definition: MPSolver.java:393
int numConstraints()
Returns the number of constraints.
Definition: MPSolver.java:180
MPSolver.ResultStatus solve()
Solves the problem using the default parameter values.
Definition: MPSolver.java:253
ABNORMAL
abnormal, i.e., error of some kind.
Definition: MPSolver.java:644
This mathematical programming (MP) solver class is the main class though which users build and solve...
Definition: MPSolver.java:17
SAT_INTEGER_PROGRAMMING
SAT based solver (requires only integer and Boolean variables).
Definition: MPSolver.java:578