Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ModelBuilderHelper.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.modelbuilder;
10
11public class ModelBuilderHelper {
12 private transient long swigCPtr;
13 protected transient boolean swigCMemOwn;
14
15 protected ModelBuilderHelper(long cPtr, boolean cMemoryOwn) {
16 swigCMemOwn = cMemoryOwn;
17 swigCPtr = cPtr;
18 }
19
20 protected static long getCPtr(ModelBuilderHelper obj) {
21 return (obj == null) ? 0 : obj.swigCPtr;
22 }
23
24 protected static long swigRelease(ModelBuilderHelper obj) {
25 long ptr = 0;
26 if (obj != null) {
27 if (!obj.swigCMemOwn)
28 throw new RuntimeException("Cannot release ownership as memory is not owned");
29 ptr = obj.swigCPtr;
30 obj.swigCMemOwn = false;
31 obj.delete();
32 }
33 return ptr;
34 }
35
36 @SuppressWarnings({"deprecation", "removal"})
37 protected void finalize() {
38 delete();
39 }
40
41 public synchronized void delete() {
42 if (swigCPtr != 0) {
43 if (swigCMemOwn) {
44 swigCMemOwn = false;
45 mainJNI.delete_ModelBuilderHelper(swigCPtr);
46 }
47 swigCPtr = 0;
48 }
49 }
50
51 public void overwriteModel(ModelBuilderHelper other_helper) {
52 mainJNI.ModelBuilderHelper_overwriteModel(swigCPtr, this, ModelBuilderHelper.getCPtr(other_helper), other_helper);
53 }
54
55 public boolean readModelFromProtoFile(String filename) {
56 return mainJNI.ModelBuilderHelper_readModelFromProtoFile(swigCPtr, this, filename);
57 }
58
59 public boolean writeModelToProtoFile(String filename) {
60 return mainJNI.ModelBuilderHelper_writeModelToProtoFile(swigCPtr, this, filename);
61 }
62
63 public boolean importFromMpsString(String mps_string) {
64 return mainJNI.ModelBuilderHelper_importFromMpsString(swigCPtr, this, mps_string);
65 }
66
67 public boolean importFromMpsFile(String mps_file) {
68 return mainJNI.ModelBuilderHelper_importFromMpsFile(swigCPtr, this, mps_file);
69 }
70
71 public boolean importFromLpString(String lp_string) {
72 return mainJNI.ModelBuilderHelper_importFromLpString(swigCPtr, this, lp_string);
73 }
74
75 public boolean importFromLpFile(String lp_file) {
76 return mainJNI.ModelBuilderHelper_importFromLpFile(swigCPtr, this, lp_file);
77 }
78
79 public int addVar() {
80 return mainJNI.ModelBuilderHelper_addVar(swigCPtr, this);
81 }
82
83 public void setVarLowerBound(int var_index, double lb) {
84 mainJNI.ModelBuilderHelper_setVarLowerBound(swigCPtr, this, var_index, lb);
85 }
86
87 public void setVarUpperBound(int var_index, double ub) {
88 mainJNI.ModelBuilderHelper_setVarUpperBound(swigCPtr, this, var_index, ub);
89 }
90
91 public void setVarIntegrality(int var_index, boolean is_integer) {
92 mainJNI.ModelBuilderHelper_setVarIntegrality(swigCPtr, this, var_index, is_integer);
93 }
94
95 public void setVarObjectiveCoefficient(int var_index, double coeff) {
96 mainJNI.ModelBuilderHelper_setVarObjectiveCoefficient(swigCPtr, this, var_index, coeff);
97 }
98
99 public void setVarName(int var_index, String name) {
100 mainJNI.ModelBuilderHelper_setVarName(swigCPtr, this, var_index, name);
101 }
102
103 public double getVarLowerBound(int var_index) {
104 return mainJNI.ModelBuilderHelper_getVarLowerBound(swigCPtr, this, var_index);
105 }
106
107 public double getVarUpperBound(int var_index) {
108 return mainJNI.ModelBuilderHelper_getVarUpperBound(swigCPtr, this, var_index);
109 }
110
111 public boolean getVarIntegrality(int var_index) {
112 return mainJNI.ModelBuilderHelper_getVarIntegrality(swigCPtr, this, var_index);
113 }
114
115 public double getVarObjectiveCoefficient(int var_index) {
116 return mainJNI.ModelBuilderHelper_getVarObjectiveCoefficient(swigCPtr, this, var_index);
117 }
118
119 public String getVarName(int var_index) {
120 return mainJNI.ModelBuilderHelper_getVarName(swigCPtr, this, var_index);
121 }
122
123 public double getConstraintLowerBound(int ct_index) {
124 return mainJNI.ModelBuilderHelper_getConstraintLowerBound(swigCPtr, this, ct_index);
125 }
126
127 public double getConstraintUpperBound(int ct_index) {
128 return mainJNI.ModelBuilderHelper_getConstraintUpperBound(swigCPtr, this, ct_index);
129 }
130
131 public int addLinearConstraint() {
132 return mainJNI.ModelBuilderHelper_addLinearConstraint(swigCPtr, this);
133 }
134
135 public String getConstraintName(int ct_index) {
136 return mainJNI.ModelBuilderHelper_getConstraintName(swigCPtr, this, ct_index);
137 }
138
139 public double[] getConstraintCoefficients(int ct_index) {
140 return mainJNI.ModelBuilderHelper_getConstraintCoefficients(swigCPtr, this, ct_index);
141}
142
143 public int[] getConstraintVarIndices(int ct_index) {
144 return mainJNI.ModelBuilderHelper_getConstraintVarIndices(swigCPtr, this, ct_index);
145}
146
147 public void addConstraintTerm(int ct_index, int var_index, double coeff) {
148 mainJNI.ModelBuilderHelper_addConstraintTerm(swigCPtr, this, ct_index, var_index, coeff);
149 }
150
151 public void clearConstraintTerms(int ct_index) {
152 mainJNI.ModelBuilderHelper_clearConstraintTerms(swigCPtr, this, ct_index);
153 }
154
155 public void safeAddConstraintTerm(int ct_index, int var_index, double coeff) {
156 mainJNI.ModelBuilderHelper_safeAddConstraintTerm(swigCPtr, this, ct_index, var_index, coeff);
157 }
158
159 public void setConstraintCoefficient(int ct_index, int var_index, double coeff) {
160 mainJNI.ModelBuilderHelper_setConstraintCoefficient(swigCPtr, this, ct_index, var_index, coeff);
161 }
162
163 public void setConstraintLowerBound(int ct_index, double lb) {
164 mainJNI.ModelBuilderHelper_setConstraintLowerBound(swigCPtr, this, ct_index, lb);
165 }
166
167 public void setConstraintName(int ct_index, String name) {
168 mainJNI.ModelBuilderHelper_setConstraintName(swigCPtr, this, ct_index, name);
169 }
170
171 public void setConstraintUpperBound(int ct_index, double ub) {
172 mainJNI.ModelBuilderHelper_setConstraintUpperBound(swigCPtr, this, ct_index, ub);
173 }
174
175 public boolean getEnforcedIndicatorValue(int ct_index) {
176 return mainJNI.ModelBuilderHelper_getEnforcedIndicatorValue(swigCPtr, this, ct_index);
177 }
178
179 public boolean isEnforcedConstraint(int ct_index) {
180 return mainJNI.ModelBuilderHelper_isEnforcedConstraint(swigCPtr, this, ct_index);
181 }
182
183 public double getEnforcedConstraintLowerBound(int ct_index) {
184 return mainJNI.ModelBuilderHelper_getEnforcedConstraintLowerBound(swigCPtr, this, ct_index);
185 }
186
187 public double getEnforcedConstraintUpperBound(int ct_index) {
188 return mainJNI.ModelBuilderHelper_getEnforcedConstraintUpperBound(swigCPtr, this, ct_index);
189 }
190
192 return mainJNI.ModelBuilderHelper_addEnforcedLinearConstraint(swigCPtr, this);
193 }
194
195 public int getEnforcedIndicatorVariableIndex(int ct_index) {
196 return mainJNI.ModelBuilderHelper_getEnforcedIndicatorVariableIndex(swigCPtr, this, ct_index);
197 }
198
199 public String getEnforcedConstraintName(int ct_index) {
200 return mainJNI.ModelBuilderHelper_getEnforcedConstraintName(swigCPtr, this, ct_index);
201 }
202
203 public double[] getEnforcedConstraintCoefficients(int ct_index) {
204 return mainJNI.ModelBuilderHelper_getEnforcedConstraintCoefficients(swigCPtr, this, ct_index);
205}
206
207 public int[] getEnforcedConstraintVarIndices(int ct_index) {
208 return mainJNI.ModelBuilderHelper_getEnforcedConstraintVarIndices(swigCPtr, this, ct_index);
209}
210
211 public void addEnforcedConstraintTerm(int ct_index, int var_index, double coeff) {
212 mainJNI.ModelBuilderHelper_addEnforcedConstraintTerm(swigCPtr, this, ct_index, var_index, coeff);
213 }
214
215 public void clearEnforcedConstraintTerms(int ct_index) {
216 mainJNI.ModelBuilderHelper_clearEnforcedConstraintTerms(swigCPtr, this, ct_index);
217 }
218
219 public void safeAddEnforcedConstraintTerm(int ct_index, int var_index, double coeff) {
220 mainJNI.ModelBuilderHelper_safeAddEnforcedConstraintTerm(swigCPtr, this, ct_index, var_index, coeff);
221 }
222
223 public void setEnforcedConstraintCoefficient(int ct_index, int var_index, double coeff) {
224 mainJNI.ModelBuilderHelper_setEnforcedConstraintCoefficient(swigCPtr, this, ct_index, var_index, coeff);
225 }
226
227 public void setEnforcedConstraintLowerBound(int ct_index, double lb) {
228 mainJNI.ModelBuilderHelper_setEnforcedConstraintLowerBound(swigCPtr, this, ct_index, lb);
229 }
230
231 public void setEnforcedConstraintName(int ct_index, String name) {
232 mainJNI.ModelBuilderHelper_setEnforcedConstraintName(swigCPtr, this, ct_index, name);
233 }
234
235 public void setEnforcedConstraintUpperBound(int ct_index, double ub) {
236 mainJNI.ModelBuilderHelper_setEnforcedConstraintUpperBound(swigCPtr, this, ct_index, ub);
237 }
238
239 public void setEnforcedIndicatorValue(int ct_index, boolean positive) {
240 mainJNI.ModelBuilderHelper_setEnforcedIndicatorValue(swigCPtr, this, ct_index, positive);
241 }
242
243 public void setEnforcedIndicatorVariableIndex(int ct_index, int var_index) {
244 mainJNI.ModelBuilderHelper_setEnforcedIndicatorVariableIndex(swigCPtr, this, ct_index, var_index);
245 }
246
247 public int numConstraints() {
248 return mainJNI.ModelBuilderHelper_numConstraints(swigCPtr, this);
249 }
250
251 public int numVariables() {
252 return mainJNI.ModelBuilderHelper_numVariables(swigCPtr, this);
253 }
254
255 public String getName() {
256 return mainJNI.ModelBuilderHelper_getName(swigCPtr, this);
257 }
258
259 public void setName(String name) {
260 mainJNI.ModelBuilderHelper_setName(swigCPtr, this, name);
261 }
262
263 public void clearObjective() {
264 mainJNI.ModelBuilderHelper_clearObjective(swigCPtr, this);
265 }
266
267 public boolean getMaximize() {
268 return mainJNI.ModelBuilderHelper_getMaximize(swigCPtr, this);
269 }
270
271 public void setMaximize(boolean maximize) {
272 mainJNI.ModelBuilderHelper_setMaximize(swigCPtr, this, maximize);
273 }
274
275 public double getObjectiveOffset() {
276 return mainJNI.ModelBuilderHelper_getObjectiveOffset(swigCPtr, this);
277 }
278
279 public void setObjectiveOffset(double offset) {
280 mainJNI.ModelBuilderHelper_setObjectiveOffset(swigCPtr, this, offset);
281 }
282
283 public void clearHints() {
284 mainJNI.ModelBuilderHelper_clearHints(swigCPtr, this);
285 }
286
287 public void addHint(int var_index, double var_value) {
288 mainJNI.ModelBuilderHelper_addHint(swigCPtr, this, var_index, var_value);
289 }
290
291 public String exportToMpsString(boolean obfuscate) {
292 return mainJNI.ModelBuilderHelper_exportToMpsString(swigCPtr, this, obfuscate);
293 }
294
295 public String exportToLpString(boolean obfuscate) {
296 return mainJNI.ModelBuilderHelper_exportToLpString(swigCPtr, this, obfuscate);
297 }
298
299 public boolean writeToMpsFile(String filename, boolean obfuscate) {
300 return mainJNI.ModelBuilderHelper_writeToMpsFile(swigCPtr, this, filename, obfuscate);
301 }
302
304 this(mainJNI.new_ModelBuilderHelper(), true);
305 }
306
307}
void safeAddConstraintTerm(int ct_index, int var_index, double coeff)
void setVarObjectiveCoefficient(int var_index, double coeff)
void addEnforcedConstraintTerm(int ct_index, int var_index, double coeff)
void setEnforcedConstraintCoefficient(int ct_index, int var_index, double coeff)
void setConstraintCoefficient(int ct_index, int var_index, double coeff)
void safeAddEnforcedConstraintTerm(int ct_index, int var_index, double coeff)
void setEnforcedIndicatorVariableIndex(int ct_index, int var_index)
boolean writeToMpsFile(String filename, boolean obfuscate)
void setVarIntegrality(int var_index, boolean is_integer)
void setEnforcedIndicatorValue(int ct_index, boolean positive)
void overwriteModel(ModelBuilderHelper other_helper)
void addConstraintTerm(int ct_index, int var_index, double coeff)