9 package com.google.ortools.linearsolver;
11 import java.lang.reflect.*;
18 private transient long swigCPtr;
19 protected transient boolean swigCMemOwn;
21 protected MPSolver(
long cPtr,
boolean cMemoryOwn) {
22 swigCMemOwn = cMemoryOwn;
26 protected static long getCPtr(
MPSolver obj) {
27 return (obj ==
null) ? 0 : obj.swigCPtr;
30 @SuppressWarnings(
"deprecation")
31 protected
void finalize() {
35 public synchronized void delete() {
47 for (
int i = 0; i < count; ++i) {
48 array[i] =
makeVar(lb, ub, integer,
"");
56 for (
int i = 0; i < count; ++i) {
57 array[i] =
makeVar(lb, ub, integer, var_name + i);
132 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
144 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
152 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
160 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
168 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
196 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
209 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
217 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
225 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
233 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
241 return (cPtr == 0) ? null :
new MPObjective(cPtr,
false);
345 public SWIGTYPE_p_util__Status
loadSolutionFromProto(SWIGTYPE_p_operations_research__MPSolutionResponse response,
double tolerance) {
483 if (buf ==
null || buf.length == 0) {
488 }
catch (
com.
google.protobuf.InvalidProtocolBufferException e) {
489 throw new RuntimeException(
490 "Unable to parse com.google.ortools.linearsolver.MPModelProto protocol message.");
496 if (buf ==
null || buf.length == 0) {
501 }
catch (
com.
google.protobuf.InvalidProtocolBufferException e) {
502 throw new RuntimeException(
503 "Unable to parse com.google.ortools.linearsolver.MPSolutionResponse protocol message.");
509 if (buf ==
null || buf.length == 0) {
514 }
catch (
com.
google.protobuf.InvalidProtocolBufferException e) {
515 throw new RuntimeException(
516 "Unable to parse com.google.ortools.linearsolver.MPSolutionResponse protocol message.");
580 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
581 return swigValues[swigValue];
583 if (swigEnum.swigValue == swigValue)
588 @SuppressWarnings(
"unused")
590 this.swigValue = SwigNext.next++;
593 @SuppressWarnings(
"unused")
594 private OptimizationProblemType(
int swigValue) {
595 this.swigValue = swigValue;
596 SwigNext.next = swigValue+1;
599 @SuppressWarnings(
"unused")
600 private OptimizationProblemType(OptimizationProblemType swigEnum) {
601 this.swigValue = swigEnum.swigValue;
602 SwigNext.next = this.swigValue+1;
605 private final int swigValue;
607 private static class SwigNext {
608 private static int next = 0;
650 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
651 return swigValues[swigValue];
653 if (swigEnum.swigValue == swigValue)
655 throw new IllegalArgumentException(
"No enum " +
ResultStatus.class +
" with value " + swigValue);
658 @SuppressWarnings(
"unused")
660 this.swigValue = SwigNext.next++;
663 @SuppressWarnings(
"unused")
664 private ResultStatus(
int swigValue) {
665 this.swigValue = swigValue;
666 SwigNext.next = swigValue+1;
669 @SuppressWarnings(
"unused")
670 private ResultStatus(ResultStatus swigEnum) {
671 this.swigValue = swigEnum.swigValue;
672 SwigNext.next = this.swigValue+1;
675 private final int swigValue;
677 private static class SwigNext {
678 private static int next = 0;
699 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
700 return swigValues[swigValue];
702 if (swigEnum.swigValue == swigValue)
704 throw new IllegalArgumentException(
"No enum " +
BasisStatus.class +
" with value " + swigValue);
707 @SuppressWarnings(
"unused")
709 this.swigValue = SwigNext.next++;
712 @SuppressWarnings(
"unused")
713 private BasisStatus(
int swigValue) {
714 this.swigValue = swigValue;
715 SwigNext.next = swigValue+1;
718 @SuppressWarnings(
"unused")
719 private BasisStatus(BasisStatus swigEnum) {
720 this.swigValue = swigEnum.swigValue;
721 SwigNext.next = this.swigValue+1;
724 private final int swigValue;
726 private static class SwigNext {
727 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_)