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);
100 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
105 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
110 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
115 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
120 return (cPtr == 0) ? null :
new MPVariable(cPtr,
false);
129 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
134 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
139 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
144 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
149 return (cPtr == 0) ? null :
new MPConstraint(cPtr,
false);
154 return (cPtr == 0) ? null :
new MPObjective(cPtr,
false);
259 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
260 return swigValues[swigValue];
262 if (swigEnum.swigValue == swigValue)
267 @SuppressWarnings(
"unused")
269 this.swigValue = SwigNext.next++;
272 @SuppressWarnings(
"unused")
273 private OptimizationProblemType(
int swigValue) {
274 this.swigValue = swigValue;
275 SwigNext.next = swigValue+1;
278 @SuppressWarnings(
"unused")
279 private OptimizationProblemType(OptimizationProblemType swigEnum) {
280 this.swigValue = swigEnum.swigValue;
281 SwigNext.next = this.swigValue+1;
284 private final int swigValue;
286 private static class SwigNext {
287 private static int next = 0;
305 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
306 return swigValues[swigValue];
308 if (swigEnum.swigValue == swigValue)
310 throw new IllegalArgumentException(
"No enum " +
ResultStatus.class +
" with value " + swigValue);
313 @SuppressWarnings(
"unused")
315 this.swigValue = SwigNext.next++;
318 @SuppressWarnings(
"unused")
319 private ResultStatus(
int swigValue) {
320 this.swigValue = swigValue;
321 SwigNext.next = swigValue+1;
324 @SuppressWarnings(
"unused")
325 private ResultStatus(ResultStatus swigEnum) {
326 this.swigValue = swigEnum.swigValue;
327 SwigNext.next = this.swigValue+1;
330 private final int swigValue;
332 private static class SwigNext {
333 private static int next = 0;
350 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
351 return swigValues[swigValue];
353 if (swigEnum.swigValue == swigValue)
355 throw new IllegalArgumentException(
"No enum " +
BasisStatus.class +
" with value " + swigValue);
358 @SuppressWarnings(
"unused")
360 this.swigValue = SwigNext.next++;
363 @SuppressWarnings(
"unused")
364 private BasisStatus(
int swigValue) {
365 this.swigValue = swigValue;
366 SwigNext.next = swigValue+1;
369 @SuppressWarnings(
"unused")
370 private BasisStatus(BasisStatus swigEnum) {
371 this.swigValue = swigEnum.swigValue;
372 SwigNext.next = this.swigValue+1;
375 private final int swigValue;
377 private static class SwigNext {
378 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 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_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 void MPSolver_setHint(long jarg1, MPSolver jarg1_, MPVariable[] jarg2, double[] jarg3)
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 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_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_)