9 package com.google.ortools.linearsolver;
11 import java.lang.reflect.*;
14 private transient long swigCPtr;
15 protected transient boolean swigCMemOwn;
17 protected MPSolver(
long cPtr,
boolean cMemoryOwn) {
18 swigCMemOwn = cMemoryOwn;
22 protected static long getCPtr(
MPSolver obj) {
23 return (obj ==
null) ? 0 : obj.swigCPtr;
26 @SuppressWarnings(
"deprecation")
27 protected
void finalize() {
31 public synchronized void delete() {
43 for (
int i = 0; i < count; ++i) {
44 array[i] =
makeVar(lb, ub, integer,
"");
52 for (
int i = 0; i < count; ++i) {
53 array[i] =
makeVar(lb, ub, integer, var_name + i);
104 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
109 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
114 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
119 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
124 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
137 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
142 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
147 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
152 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
157 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
162 return (cPtr == 0) ? null :
new MPObjective(cPtr,
false);
189 public SWIGTYPE_p_util__Status
loadSolutionFromProto(SWIGTYPE_p_operations_research__MPSolutionResponse response,
double tolerance) {
243 if (buf ==
null || buf.length == 0) {
248 }
catch (
com.
google.protobuf.InvalidProtocolBufferException e) {
249 throw new RuntimeException(
250 "Unable to parse com.google.ortools.linearsolver.MPModelProto protocol message.");
256 if (buf ==
null || buf.length == 0) {
261 }
catch (
com.
google.protobuf.InvalidProtocolBufferException e) {
262 throw new RuntimeException(
263 "Unable to parse com.google.ortools.linearsolver.MPSolutionResponse protocol message.");
269 if (buf ==
null || buf.length == 0) {
274 }
catch (
com.
google.protobuf.InvalidProtocolBufferException e) {
275 throw new RuntimeException(
276 "Unable to parse com.google.ortools.linearsolver.MPSolutionResponse protocol message.");
322 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
323 return swigValues[swigValue];
325 if (swigEnum.swigValue == swigValue)
330 @SuppressWarnings(
"unused")
332 this.swigValue = SwigNext.next++;
335 @SuppressWarnings(
"unused")
336 private OptimizationProblemType(
int swigValue) {
337 this.swigValue = swigValue;
338 SwigNext.next = swigValue+1;
341 @SuppressWarnings(
"unused")
342 private OptimizationProblemType(OptimizationProblemType swigEnum) {
343 this.swigValue = swigEnum.swigValue;
344 SwigNext.next = this.swigValue+1;
347 private final int swigValue;
349 private static class SwigNext {
350 private static int next = 0;
368 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
369 return swigValues[swigValue];
371 if (swigEnum.swigValue == swigValue)
373 throw new IllegalArgumentException(
"No enum " +
ResultStatus.class +
" with value " + swigValue);
376 @SuppressWarnings(
"unused")
378 this.swigValue = SwigNext.next++;
381 @SuppressWarnings(
"unused")
382 private ResultStatus(
int swigValue) {
383 this.swigValue = swigValue;
384 SwigNext.next = swigValue+1;
387 @SuppressWarnings(
"unused")
388 private ResultStatus(ResultStatus swigEnum) {
389 this.swigValue = swigEnum.swigValue;
390 SwigNext.next = this.swigValue+1;
393 private final int swigValue;
395 private static class SwigNext {
396 private static int next = 0;
413 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
414 return swigValues[swigValue];
416 if (swigEnum.swigValue == swigValue)
418 throw new IllegalArgumentException(
"No enum " +
BasisStatus.class +
" with value " + swigValue);
421 @SuppressWarnings(
"unused")
423 this.swigValue = SwigNext.next++;
426 @SuppressWarnings(
"unused")
427 private BasisStatus(
int swigValue) {
428 this.swigValue = swigValue;
429 SwigNext.next = swigValue+1;
432 @SuppressWarnings(
"unused")
433 private BasisStatus(BasisStatus swigEnum) {
434 this.swigValue = swigEnum.swigValue;
435 SwigNext.next = this.swigValue+1;
438 private final int swigValue;
440 private static class SwigNext {
441 private static int next = 0;
static final native long MPSolver_iterations(long jarg1, MPSolver jarg1_)
static final native int MPSolver_solve__SWIG_0(long jarg1, MPSolver jarg1_)
static final native int MPSolver_CLP_LINEAR_PROGRAMMING_get()
static final native void MPSolver_suppressOutput(long jarg1, MPSolver jarg1_)
static final native int MPSolver_numConstraints(long jarg1, MPSolver jarg1_)
static final native long MPSolver_makeConstraint__SWIG_1(long jarg1, MPSolver jarg1_)
static final native int MPSolver_FREE_get()
static final native String MPSolver_loadModelFromProtoWithUniqueNamesOrDie(long jarg1, MPSolver jarg1_, byte[] jarg2)
static final native MPVariable [] MPSolver_variables(long jarg1, MPSolver jarg1_)
static final native byte [] MPSolver_exportModelToProto(long jarg1, MPSolver jarg1_)
static final native int MPSolver_BOP_INTEGER_PROGRAMMING_get()
static final native long MPSolver_makeConstraint__SWIG_0(long jarg1, MPSolver jarg1_, double jarg2, double jarg3)
static final native String MPSolver_loadModelFromProto(long jarg1, MPSolver jarg1_, byte[] jarg2)
static final native String MPSolver_exportModelAsLpFormat__SWIG_1(long jarg1, MPSolver jarg1_)
static final native boolean MPSolver_supportsProblemType(int jarg1)
static final native long MPSolver_makeIntVar(long jarg1, MPSolver jarg1_, double jarg2, double jarg3, String jarg4)
static final native boolean MPSolver_setSolverSpecificParametersAsString(long jarg1, MPSolver jarg1_, String jarg2)
static final native long MPSolver_loadSolutionFromProto__SWIG_0(long jarg1, MPSolver jarg1_, long jarg2, double jarg3)
static final native void MPSolver_setHint(long jarg1, MPSolver jarg1_, MPVariable[] jarg2, double[] jarg3)
static final native byte [] MPSolver_solveWithProto(byte[] jarg1)
static final native String MPSolver_exportModelAsMpsFormat__SWIG_1(long jarg1, MPSolver jarg1_)
static final native void MPSolver_setTimeLimit(long jarg1, MPSolver jarg1_, long jarg2)
static final native int MPSolver_solve__SWIG_1(long jarg1, MPSolver jarg1_, long jarg2, MPSolverParameters jarg2_)
static final native long MPSolver_makeConstraint__SWIG_2(long jarg1, MPSolver jarg1_, double jarg2, double jarg3, String jarg4)
static final native int MPSolver_NOT_SOLVED_get()
static final native int MPSolver_GLOP_LINEAR_PROGRAMMING_get()
static final native void MPSolver_reset(long jarg1, MPSolver jarg1_)
static final native boolean MPSolver_setNumThreads(long jarg1, MPSolver jarg1_, int jarg2)
static final native MPConstraint [] MPSolver_constraints(long jarg1, MPSolver jarg1_)
static final native long MPSolver_makeBoolVar(long jarg1, MPSolver jarg1_, String jarg2)
static final native String MPSolver_exportModelAsMpsFormat__SWIG_0(long jarg1, MPSolver jarg1_, long jarg2, MPModelExportOptions jarg2_)
static final native void MPSolver_enableOutput(long jarg1, MPSolver jarg1_)
static final native double MPSolver_infinity()
static final native long MPSolver_objective(long jarg1, MPSolver jarg1_)
static final native boolean MPSolver_verifySolution(long jarg1, MPSolver jarg1_, double jarg2, boolean jarg3)
static final native long MPSolver_loadSolutionFromProto__SWIG_1(long jarg1, MPSolver jarg1_, long jarg2)
static final native long MPSolver_makeConstraint__SWIG_3(long jarg1, MPSolver jarg1_, String jarg2)
static final native int MPSolver_CBC_MIXED_INTEGER_PROGRAMMING_get()
static final native long MPSolver_wallTime(long jarg1, MPSolver jarg1_)
static final native long new_MPSolver(String jarg1, int jarg2)
static final native long MPSolver_lookupVariableOrNull(long jarg1, MPSolver jarg1_, String jarg2)
static final native long MPSolver_makeVar(long jarg1, MPSolver jarg1_, double jarg2, double jarg3, boolean jarg4, String jarg5)
static final native double [] MPSolver_computeConstraintActivities(long jarg1, MPSolver jarg1_)
static final native void MPSolver_clear(long jarg1, MPSolver jarg1_)
static final native long MPSolver_lookupConstraintOrNull(long jarg1, MPSolver jarg1_, String jarg2)
static final native String MPSolver_exportModelAsLpFormat__SWIG_0(long jarg1, MPSolver jarg1_, long jarg2, MPModelExportOptions jarg2_)
static final native int MPSolver_numVariables(long jarg1, MPSolver jarg1_)
static final native void delete_MPSolver(long jarg1)
static final native long MPSolver_nodes(long jarg1, MPSolver jarg1_)
static final native boolean MPSolver_interruptSolve(long jarg1, MPSolver jarg1_)
static final native long MPSolver_makeNumVar(long jarg1, MPSolver jarg1_, double jarg2, double jarg3, String jarg4)
static final native double MPSolver_computeExactConditionNumber(long jarg1, MPSolver jarg1_)
static final native byte [] MPSolver_createSolutionResponseProto(long jarg1, MPSolver jarg1_)