Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
IntExpr.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
13using System;
14using System.Runtime.InteropServices;
15using System.Collections;
16using System.Collections.Generic;
17
18public partial class IntExpr : PropagationBaseObject {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal IntExpr(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.IntExpr_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(IntExpr obj) {
26 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
27 }
28
29 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(IntExpr obj) {
30 if (obj != null) {
31 if (!obj.swigCMemOwn)
32 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
33 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
34 obj.swigCMemOwn = false;
35 obj.Dispose();
36 return ptr;
37 } else {
38 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
39 }
40 }
41
42 protected override void Dispose(bool disposing) {
43 lock(this) {
44 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
45 if (swigCMemOwn) {
46 swigCMemOwn = false;
48 }
49 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
50 }
51 base.Dispose(disposing);
52 }
53 }
54
55 // Keep reference to delegate to avoid GC to collect them early
56 private List<VoidToVoid> closureCallbacks;
57 private VoidToVoid StoreVoidToVoid(VoidToVoid closure) {
58 if (closureCallbacks == null)
59 closureCallbacks = new List<VoidToVoid>();
60 closureCallbacks.Add(closure);
61 return closure;
62 }
63
64 public virtual long Min() {
65 long ret = operations_research_constraint_solverPINVOKE.IntExpr_Min(swigCPtr);
66 return ret;
67 }
68
69 public virtual void SetMin(long m) {
76 return ret;
77 }
78
79 public virtual void SetMax(long m) {
86 }
87
88 public virtual void SetRange(long l, long u) {
100 return ret;
101 }
102
103 public virtual bool IsVar() {
105 return ret;
106 }
107
108 public virtual IntVar Var() {
109 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_Var(swigCPtr);
110 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
111 return ret;
112 }
113
114 public IntVar VarWithName(string name) {
115 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_VarWithName(swigCPtr, name);
116 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
118 return ret;
119 }
120
121 public virtual void WhenRange(Demon d) {
124
125 public void WhenRange( VoidToVoid closure) {
128
129 public virtual void Accept(ModelVisitor visitor) {
132
133 public Constraint MapTo(IntVarVector vars) {
134 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_MapTo(swigCPtr, IntVarVector.getCPtr(vars));
135 Constraint ret = (cPtr == global::System.IntPtr.Zero) ? null : new Constraint(cPtr, false);
137 return ret;
138 }
139
140 public IntExpr IndexOf( long[] vars) {
141 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IndexOf__SWIG_0(swigCPtr, vars.Length, vars );
142 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntExpr(cPtr, false);
143 return ret;
144 }
145
146 public IntExpr IndexOf(IntVarVector vars) {
147 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IndexOf__SWIG_1(swigCPtr, IntVarVector.getCPtr(vars));
148 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntExpr(cPtr, false);
150 return ret;
151 }
152
153 public IntVar IsEqual(long value) {
154 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsEqual__SWIG_0(swigCPtr, value);
155 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
156 return ret;
157 }
158
159 public IntVar IsDifferent(long value) {
160 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsDifferent__SWIG_0(swigCPtr, value);
161 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
162 return ret;
163 }
164
165 public IntVar IsGreater(long value) {
166 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsGreater__SWIG_0(swigCPtr, value);
167 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
168 return ret;
169 }
170
171 public IntVar IsGreaterOrEqual(long value) {
172 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsGreaterOrEqual__SWIG_0(swigCPtr, value);
173 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
174 return ret;
175 }
176
177 public IntVar IsLess(long value) {
178 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsLess__SWIG_0(swigCPtr, value);
179 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
180 return ret;
181 }
182
183 public IntVar IsLessOrEqual(long value) {
184 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsLessOrEqual__SWIG_0(swigCPtr, value);
185 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
186 return ret;
187 }
188
189 public IntVar IsMember( long[] values) {
190 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsMember__SWIG_0(swigCPtr, values.Length, values );
191 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
192 return ret;
193 }
194
195 public IntVar IsMember( int[] values) {
196 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsMember__SWIG_1(swigCPtr, values.Length, values );
197 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
198 return ret;
199 }
200
201 public Constraint Member( long[] values) {
202 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_Member__SWIG_0(swigCPtr, values.Length, values );
203 Constraint ret = (cPtr == global::System.IntPtr.Zero) ? null : new Constraint(cPtr, false);
204 return ret;
205 }
206
207 public Constraint Member( int[] values) {
208 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_Member__SWIG_1(swigCPtr, values.Length, values );
209 Constraint ret = (cPtr == global::System.IntPtr.Zero) ? null : new Constraint(cPtr, false);
210 return ret;
211 }
212
213 public IntVar IsEqual(IntExpr other) {
214 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsEqual__SWIG_1(swigCPtr, IntExpr.getCPtr(other));
215 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
216 return ret;
217 }
218
219 public IntVar IsDifferent(IntExpr other) {
220 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsDifferent__SWIG_1(swigCPtr, IntExpr.getCPtr(other));
221 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
222 return ret;
223 }
224
225 public IntVar IsGreater(IntExpr other) {
226 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsGreater__SWIG_1(swigCPtr, IntExpr.getCPtr(other));
227 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
228 return ret;
229 }
230
231 public IntVar IsGreaterOrEqual(IntExpr other) {
232 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsGreaterOrEqual__SWIG_1(swigCPtr, IntExpr.getCPtr(other));
233 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
234 return ret;
235 }
236
237 public IntVar IsLess(IntExpr other) {
238 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsLess__SWIG_1(swigCPtr, IntExpr.getCPtr(other));
239 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
240 return ret;
241 }
242
243 public IntVar IsLessOrEqual(IntExpr other) {
244 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_IsLessOrEqual__SWIG_1(swigCPtr, IntExpr.getCPtr(other));
245 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
246 return ret;
247 }
248
249 public OptimizeVar Minimize(long step) {
250 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_Minimize(swigCPtr, step);
251 OptimizeVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new OptimizeVar(cPtr, false);
252 return ret;
253 }
254
255 public OptimizeVar Maximize(long step) {
256 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntExpr_Maximize(swigCPtr, step);
257 OptimizeVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new OptimizeVar(cPtr, false);
258 return ret;
259 }
260
261}
262
263}
virtual void SetRange(long l, long u)
Definition IntExpr.cs:90
OptimizeVar Minimize(long step)
Definition IntExpr.cs:251
virtual void WhenRange(Demon d)
Definition IntExpr.cs:123
Constraint MapTo(IntVarVector vars)
Definition IntExpr.cs:135
Constraint Member(long[] values)
Definition IntExpr.cs:203
virtual void Range(out int l, out int u)
Definition IntExpr.cs:86
OptimizeVar Maximize(long step)
Definition IntExpr.cs:257
virtual void Accept(ModelVisitor visitor)
Definition IntExpr.cs:131
static void IntExpr_SetMin(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr IntExpr_Minimize(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void IntExpr_Range(global::System.Runtime.InteropServices.HandleRef jarg1, out int jarg2, out int jarg3)
static void IntExpr_SetValue(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr IntExpr_IsLess__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void IntExpr_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, long jarg3)
static global::System.IntPtr IntExpr_IsMember__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, int[] jarg2)
static global::System.IntPtr IntExpr_IsMember__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, long[] jarg2)
static global::System.IntPtr IntExpr_IsLessOrEqual__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void IntExpr_WhenRange__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, VoidToVoid jarg2)
static long IntExpr_Max(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr IntExpr_IsGreater__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr IntExpr_Maximize(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr IntExpr_Member__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, long[] jarg2)
static global::System.IntPtr IntExpr_IsDifferent__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static bool IntExpr_IsVar(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr IntExpr_IsEqual__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static bool IntExpr_Bound(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr IntExpr_IsLessOrEqual__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr IntExpr_IsLess__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void IntExpr_SetMax(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void delete_IntExpr(global::System.Runtime.InteropServices.HandleRef jarg1)
static void IntExpr_WhenRange__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr IntExpr_IsEqual__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr IntExpr_IndexOf__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr IntExpr_MapTo(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr IntExpr_IsGreater__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr IntExpr_IsGreaterOrEqual__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr IntExpr_IsGreaterOrEqual__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr IntExpr_IsDifferent__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr IntExpr_Member__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, int[] jarg2)
static global::System.IntPtr IntExpr_IndexOf__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, long[] jarg2)
static void IntExpr_Accept(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr IntExpr_Var(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr IntExpr_VarWithName(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
delegate void VoidToVoid()
Used to wrap Closure (std::function<void()>)