Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ModelBuilderHelper.cs
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// <auto-generated />
3//
4// This file was automatically generated by SWIG (https://www.swig.org).
5// Version 4.2.1
6//
7// Do not make changes to this file unless you know what you are doing - modify
8// the SWIG interface file instead.
9//------------------------------------------------------------------------------
10
12
13public class ModelBuilderHelper : global::System.IDisposable {
14 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
15 protected bool swigCMemOwn;
16
17 internal ModelBuilderHelper(global::System.IntPtr cPtr, bool cMemoryOwn) {
18 swigCMemOwn = cMemoryOwn;
19 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
20 }
21
22 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ModelBuilderHelper obj) {
23 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
24 }
25
26 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(ModelBuilderHelper obj) {
27 if (obj != null) {
28 if (!obj.swigCMemOwn)
29 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
30 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
31 obj.swigCMemOwn = false;
32 obj.Dispose();
33 return ptr;
34 } else {
35 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
36 }
37 }
38
39 ~ModelBuilderHelper() {
40 Dispose(false);
41 }
42
43 public void Dispose() {
44 Dispose(true);
45 global::System.GC.SuppressFinalize(this);
46 }
47
48 protected virtual void Dispose(bool disposing) {
49 lock(this) {
50 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
51 if (swigCMemOwn) {
52 swigCMemOwn = false;
54 }
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
56 }
57 }
58 }
59
60 public void OverwriteModel(ModelBuilderHelper other_helper) {
61 operations_research_model_builderPINVOKE.ModelBuilderHelper_OverwriteModel(swigCPtr, ModelBuilderHelper.getCPtr(other_helper));
103 return ret;
104 }
105
106 public void SetVarLowerBound(int var_index, double lb) {
109
110 public void SetVarUpperBound(int var_index, double ub) {
113
114 public void SetVarIntegrality(int var_index, bool is_integer) {
117
118 public void SetVarObjectiveCoefficient(int var_index, double coeff) {
121
122 public void SetVarName(int var_index, string name) {
129 return ret;
130 }
131
132 public double VarUpperBound(int var_index) {
134 return ret;
135 }
136
137 public bool VarIsIntegral(int var_index) {
139 return ret;
140 }
141
142 public double VarObjectiveCoefficient(int var_index) {
144 return ret;
145 }
146
147 public string VarName(int var_index) {
149 return ret;
150 }
151
152 public double ConstraintLowerBound(int ct_index) {
154 return ret;
155 }
156
157 public double ConstraintUpperBound(int ct_index) {
159 return ret;
160 }
161
162 public int AddLinearConstraint() {
164 return ret;
165 }
166
167 public string ConstraintName(int ct_index) {
169 return ret;
170 }
171
172 public double[] ConstraintCoefficients(int ct_index) {
173 global::System.IntPtr cPtr = operations_research_model_builderPINVOKE.ModelBuilderHelper_ConstraintCoefficients(swigCPtr, ct_index);
174 DoubleVector tmpVector = null;
175 if (cPtr != global::System.IntPtr.Zero) {
176 tmpVector = new DoubleVector(cPtr, true);
177 double[] outArray = new double[tmpVector.Count];
178 tmpVector.CopyTo(outArray);
179 return outArray;
180 }
181 return null;
182}
183
184 public int[] ConstraintVarIndices(int ct_index) {
185 global::System.IntPtr cPtr = operations_research_model_builderPINVOKE.ModelBuilderHelper_ConstraintVarIndices(swigCPtr, ct_index);
186 IntVector tmpVector = null;
187 if (cPtr != global::System.IntPtr.Zero) {
188 tmpVector = new IntVector(cPtr, true);
189 int[] outArray = new int[tmpVector.Count];
190 tmpVector.CopyTo(outArray);
191 return outArray;
192 }
193 return null;
194}
195
196 public void AddConstraintTerm(int ct_index, int var_index, double coeff) {
197 operations_research_model_builderPINVOKE.ModelBuilderHelper_AddConstraintTerm(swigCPtr, ct_index, var_index, coeff);
199
200 public void ClearConstraintTerms(int ct_index) {
203
204 public void SafeAddConstraintTerm(int ct_index, int var_index, double coeff) {
207
208 public void SetConstraintCoefficient(int ct_index, int var_index, double coeff) {
211
212 public void SetConstraintLowerBound(int ct_index, double lb) {
215
216 public void SetConstraintName(int ct_index, string name) {
224
225 public bool EnforcedIndicatorValue(int ct_index) {
227 return ret;
228 }
229
230 public bool IsEnforcedConstraint(int ct_index) {
232 return ret;
233 }
234
235 public double EnforcedConstraintLowerBound(int ct_index) {
237 return ret;
238 }
239
240 public double EnforcedConstraintUpperBound(int ct_index) {
242 return ret;
243 }
244
245 public int AddEnforcedLinearConstraint() {
247 return ret;
248 }
249
250 public int EnforcedIndicatorVariableIndex(int ct_index) {
252 return ret;
253 }
254
255 public string EnforcedConstraintName(int ct_index) {
257 return ret;
258 }
259
260 public double[] EnforcedConstraintCoefficients(int ct_index) {
262 DoubleVector tmpVector = null;
263 if (cPtr != global::System.IntPtr.Zero) {
264 tmpVector = new DoubleVector(cPtr, true);
265 double[] outArray = new double[tmpVector.Count];
266 tmpVector.CopyTo(outArray);
267 return outArray;
268 }
269 return null;
270}
271
272 public int[] EnforcedConstraintVarIndices(int ct_index) {
273 global::System.IntPtr cPtr = operations_research_model_builderPINVOKE.ModelBuilderHelper_EnforcedConstraintVarIndices(swigCPtr, ct_index);
274 IntVector tmpVector = null;
275 if (cPtr != global::System.IntPtr.Zero) {
276 tmpVector = new IntVector(cPtr, true);
277 int[] outArray = new int[tmpVector.Count];
278 tmpVector.CopyTo(outArray);
279 return outArray;
280 }
281 return null;
282}
283
284 public void AddEnforcedConstraintTerm(int ct_index, int var_index, double coeff) {
285 operations_research_model_builderPINVOKE.ModelBuilderHelper_AddEnforcedConstraintTerm(swigCPtr, ct_index, var_index, coeff);
287
288 public void ClearEnforcedConstraintTerms(int ct_index) {
291
292 public void SafeAddEnforcedConstraintTerm(int ct_index, int var_index, double coeff) {
295
296 public void SetEnforcedConstraintCoefficient(int ct_index, int var_index, double coeff) {
299
300 public void SetEnforcedConstraintLowerBound(int ct_index, double lb) {
303
304 public void SetEnforcedConstraintName(int ct_index, string name) {
312
313 public void SetEnforcedIndicatorValue(int ct_index, bool positive) {
316
317 public void SetEnforcedIndicatorVariableIndex(int ct_index, int var_index) {
320
321 public int ConstraintsCount() {
323 return ret;
324 }
325
326 public int VariablesCount() {
328 return ret;
329 }
330
331 public string Name() {
333 return ret;
334 }
335
336 public void SetName(string name) {
344
345 public bool Maximize() {
347 return ret;
348 }
349
350 public void SetMaximize(bool maximize) {
353
354 public double ObjectiveOffset() {
356 return ret;
357 }
358
359 public void SetObjectiveOffset(double offset) {
362
363 public void ClearHints() {
366
367 public void AddHint(int var_index, double var_value) {
370
371 public string ExportToMpsString(bool obfuscate) {
373 return ret;
374 }
375
376 public string ExportToLpString(bool obfuscate) {
378 return ret;
379 }
380
381 public bool WriteToMpsFile(string filename, bool obfuscate) {
382 bool ret = operations_research_model_builderPINVOKE.ModelBuilderHelper_WriteToMpsFile(swigCPtr, filename, obfuscate);
388 }
390}
391
392}
void SetEnforcedConstraintCoefficient(int ct_index, int var_index, double coeff)
void SetConstraintLowerBound(int ct_index, double lb)
bool WriteToMpsFile(string filename, bool obfuscate)
void SafeAddEnforcedConstraintTerm(int ct_index, int var_index, double coeff)
void AddEnforcedConstraintTerm(int ct_index, int var_index, double coeff)
void OverwriteModel(ModelBuilderHelper other_helper)
void AddConstraintTerm(int ct_index, int var_index, double coeff)
void AddHint(int var_index, double var_value)
void SetEnforcedConstraintUpperBound(int ct_index, double ub)
void SetConstraintCoefficient(int ct_index, int var_index, double coeff)
void SetVarIntegrality(int var_index, bool is_integer)
void SetEnforcedConstraintLowerBound(int ct_index, double lb)
void SetConstraintUpperBound(int ct_index, double ub)
void SetConstraintName(int ct_index, string name)
void SetVarObjectiveCoefficient(int var_index, double coeff)
void SetEnforcedConstraintName(int ct_index, string name)
void SafeAddConstraintTerm(int ct_index, int var_index, double coeff)
void SetEnforcedIndicatorVariableIndex(int ct_index, int var_index)
void SetEnforcedIndicatorValue(int ct_index, bool positive)
static void ModelBuilderHelper_SetEnforcedConstraintLowerBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, double jarg3)
static double ModelBuilderHelper_VarUpperBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static double ModelBuilderHelper_VarObjectiveCoefficient(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ModelBuilderHelper_SetEnforcedIndicatorVariableIndex(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static global::System.IntPtr ModelBuilderHelper_ConstraintCoefficients(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static bool ModelBuilderHelper_IsEnforcedConstraint(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static double ModelBuilderHelper_EnforcedConstraintLowerBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ModelBuilderHelper_SetEnforcedConstraintUpperBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, double jarg3)
static void delete_ModelBuilderHelper(global::System.Runtime.InteropServices.HandleRef jarg1)
static double ModelBuilderHelper_ConstraintLowerBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ModelBuilderHelper_SetConstraintCoefficient(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, double jarg4)
static void ModelBuilderHelper_SetVarObjectiveCoefficient(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, double jarg3)
static void ModelBuilderHelper_SetObjectiveOffset(global::System.Runtime.InteropServices.HandleRef jarg1, double jarg2)
static void ModelBuilderHelper_SetEnforcedConstraintName(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, string jarg3)
static void ModelBuilderHelper_SafeAddConstraintTerm(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, double jarg4)
static int ModelBuilderHelper_ConstraintsCount(global::System.Runtime.InteropServices.HandleRef jarg1)
static void ModelBuilderHelper_SafeAddEnforcedConstraintTerm(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, double jarg4)
static bool ModelBuilderHelper_Maximize(global::System.Runtime.InteropServices.HandleRef jarg1)
static string ModelBuilderHelper_ExportToLpString(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
static void ModelBuilderHelper_AddHint(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, double jarg3)
static void ModelBuilderHelper_SetVarUpperBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, double jarg3)
static string ModelBuilderHelper_VarName(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ModelBuilderHelper_SetName(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
static double ModelBuilderHelper_ObjectiveOffset(global::System.Runtime.InteropServices.HandleRef jarg1)
static string ModelBuilderHelper_ExportToMpsString(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
static int ModelBuilderHelper_EnforcedIndicatorVariableIndex(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static bool ModelBuilderHelper_WriteModelToProtoFile(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
static void ModelBuilderHelper_ClearConstraintTerms(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ModelBuilderHelper_SetMaximize(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
static int ModelBuilderHelper_AddEnforcedLinearConstraint(global::System.Runtime.InteropServices.HandleRef jarg1)
static string ModelBuilderHelper_ConstraintName(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ModelBuilderHelper_SetConstraintLowerBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, double jarg3)
static double ModelBuilderHelper_EnforcedConstraintUpperBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ModelBuilderHelper_SetVarName(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, string jarg3)
static void ModelBuilderHelper_SetEnforcedIndicatorValue(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, bool jarg3)
static int ModelBuilderHelper_VariablesCount(global::System.Runtime.InteropServices.HandleRef jarg1)
static void ModelBuilderHelper_ClearObjective(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool ModelBuilderHelper_ImportFromLpFile(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
static int ModelBuilderHelper_AddLinearConstraint(global::System.Runtime.InteropServices.HandleRef jarg1)
static string ModelBuilderHelper_Name(global::System.Runtime.InteropServices.HandleRef jarg1)
static int ModelBuilderHelper_AddVar(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool ModelBuilderHelper_VarIsIntegral(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ModelBuilderHelper_SetConstraintUpperBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, double jarg3)
static bool ModelBuilderHelper_ImportFromMpsFile(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
static global::System.IntPtr ModelBuilderHelper_EnforcedConstraintCoefficients(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static bool ModelBuilderHelper_WriteToMpsFile(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, bool jarg3)
static void ModelBuilderHelper_ClearEnforcedConstraintTerms(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static bool ModelBuilderHelper_ImportFromLpString(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
static bool ModelBuilderHelper_ReadModelFromProtoFile(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
static void ModelBuilderHelper_SetEnforcedConstraintCoefficient(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, double jarg4)
static void ModelBuilderHelper_SetVarLowerBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, double jarg3)
static void ModelBuilderHelper_SetConstraintName(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, string jarg3)
static void ModelBuilderHelper_ClearHints(global::System.Runtime.InteropServices.HandleRef jarg1)
static string ModelBuilderHelper_EnforcedConstraintName(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static bool ModelBuilderHelper_ImportFromMpsString(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
static bool ModelBuilderHelper_EnforcedIndicatorValue(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static double ModelBuilderHelper_ConstraintUpperBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static double ModelBuilderHelper_VarLowerBound(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ModelBuilderHelper_SetVarIntegrality(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, bool jarg3)