Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
MPVariable.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.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
9package com.google.ortools.linearsolver;
10
11import java.lang.reflect.*;
12
16public class MPVariable {
17 private transient long swigCPtr;
18 protected transient boolean swigCMemOwn;
19
20 protected MPVariable(long cPtr, boolean cMemoryOwn) {
21 swigCMemOwn = cMemoryOwn;
22 swigCPtr = cPtr;
23 }
24
25 protected static long getCPtr(MPVariable obj) {
26 return (obj == null) ? 0 : obj.swigCPtr;
27 }
28
29 protected static long swigRelease(MPVariable obj) {
30 long ptr = 0;
31 if (obj != null) {
32 if (!obj.swigCMemOwn)
33 throw new RuntimeException("Cannot release ownership as memory is not owned");
34 ptr = obj.swigCPtr;
35 obj.swigCMemOwn = false;
36 obj.delete();
37 }
38 return ptr;
39 }
40
41 @SuppressWarnings({"deprecation", "removal"})
42 protected void finalize() {
43 delete();
44 }
45
46 public synchronized void delete() {
47 if (swigCPtr != 0) {
48 if (swigCMemOwn) {
49 swigCMemOwn = false;
50 mainJNI.delete_MPVariable(swigCPtr);
51 }
52 swigCPtr = 0;
53 }
54 }
55
59 public String name() {
60 return mainJNI.MPVariable_name(swigCPtr, this);
61 }
62
66 public void setInteger(boolean integer) {
67 mainJNI.MPVariable_setInteger(swigCPtr, this, integer);
68 }
69
77 public double solutionValue() {
78 return mainJNI.MPVariable_solutionValue(swigCPtr, this);
79 }
80
84 public int index() {
85 return mainJNI.MPVariable_index(swigCPtr, this);
86 }
87
91 public double lb() {
92 return mainJNI.MPVariable_lb(swigCPtr, this);
93 }
94
98 public double ub() {
99 return mainJNI.MPVariable_ub(swigCPtr, this);
100 }
101
105 public void setLb(double lb) {
106 mainJNI.MPVariable_setLb(swigCPtr, this, lb);
107 }
108
112 public void setUb(double ub) {
113 mainJNI.MPVariable_setUb(swigCPtr, this, ub);
114 }
115
119 public void setBounds(double lb, double ub) {
120 mainJNI.MPVariable_setBounds(swigCPtr, this, lb, ub);
121 }
122
127 public double reducedCost() {
128 return mainJNI.MPVariable_reducedCost(swigCPtr, this);
129 }
130
137 public MPSolver.BasisStatus basisStatus() {
138 return MPSolver.BasisStatus.swigToEnum(mainJNI.MPVariable_basisStatus(swigCPtr, this));
139 }
140
141}
MPVariable(long cPtr, boolean cMemoryOwn)
static long getCPtr(MPVariable obj)
static long swigRelease(MPVariable obj)
static BasisStatus swigToEnum(int swigValue)