14using System.Runtime.InteropServices;
15using System.Collections;
16using System.Collections.Generic;
18public partial class Solver : global::System.IDisposable {
22 internal Solver(global::System.IntPtr cPtr,
bool cMemoryOwn) {
24 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
27 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
Solver obj) {
28 return (obj ==
null) ?
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero) : obj.swigCPtr;
31 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(Solver obj) {
34 throw new global::System.ApplicationException(
"Cannot release ownership as memory is not owned");
35 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
36 obj.swigCMemOwn =
false;
40 return new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
50 global::System.GC.SuppressFinalize(
this);
53 protected virtual void Dispose(
bool disposing) {
55 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
60 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
68 private List<VoidToString> displayCallbacks;
70 if (displayCallbacks ==
null)
71 displayCallbacks =
new List<VoidToString>();
72 displayCallbacks.Add(c);
76 private List<LongToLong> LongToLongCallbacks;
78 if (LongToLongCallbacks ==
null)
79 LongToLongCallbacks =
new List<LongToLong>();
80 LongToLongCallbacks.Add(c);
83 private List<LongLongToLong> LongLongToLongCallbacks;
85 if (LongLongToLongCallbacks ==
null)
86 LongLongToLongCallbacks =
new List<LongLongToLong>();
87 LongLongToLongCallbacks.Add(c);
90 private List<LongLongLongToLong> LongLongLongToLongCallbacks;
92 if (LongLongLongToLongCallbacks ==
null)
93 LongLongLongToLongCallbacks =
new List<LongLongLongToLong>();
94 LongLongLongToLongCallbacks.Add(c);
98 private List<VoidToBoolean> limiterCallbacks;
100 if (limiterCallbacks ==
null)
101 limiterCallbacks =
new List<VoidToBoolean>();
102 limiterCallbacks.Add(limiter);
106 private List<LongLongLongToBoolean> variableValueComparatorCallbacks;
109 if (variableValueComparatorCallbacks ==
null)
110 variableValueComparatorCallbacks =
new List<LongLongLongToBoolean>();
111 variableValueComparatorCallbacks.Add(c);
115 private List<LongToBoolean> indexFilter1Callbacks;
117 if (indexFilter1Callbacks ==
null)
118 indexFilter1Callbacks =
new List<LongToBoolean>();
119 indexFilter1Callbacks.Add(c);
123 private List<LongToVoid> objectiveWatcherCallbacks;
125 if (objectiveWatcherCallbacks ==
null)
126 objectiveWatcherCallbacks =
new List<LongToVoid>();
127 objectiveWatcherCallbacks.Add(c);
131 private List<SolverToVoid> actionCallbacks;
133 if (actionCallbacks ==
null)
134 actionCallbacks =
new List<SolverToVoid>();
135 actionCallbacks.Add(action);
139 private List<VoidToVoid> closureCallbacks;
141 if (closureCallbacks ==
null)
142 closureCallbacks =
new List<VoidToVoid>();
143 closureCallbacks.Add(closure);
148 private List<IntIntToLong> evaluatorCallbacks;
150 if (evaluatorCallbacks ==
null)
151 evaluatorCallbacks =
new List<IntIntToLong>();
152 evaluatorCallbacks.Add(evaluator);
156 public partial class IntegerCastInfo : global::System.IDisposable {
157 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
162 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
165 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
IntegerCastInfo obj) {
166 return (obj ==
null) ?
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero) : obj.swigCPtr;
169 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(
IntegerCastInfo obj) {
171 if (!obj.swigCMemOwn)
172 throw new global::System.ApplicationException(
"Cannot release ownership as memory is not owned");
173 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
174 obj.swigCMemOwn =
false;
178 return new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
188 global::System.GC.SuppressFinalize(
this);
191 protected virtual void Dispose(
bool disposing) {
193 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
198 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
203 public IntegerCastInfo() : this(operations_research_constraint_solverPINVOKE.new_Solver_IntegerCastInfo__SWIG_0(), true) {
215 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null :
new IntVar(cPtr,
false);
226 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null :
new IntExpr(cPtr,
false);
244 public Solver(
string name) : this(operations_research_constraint_solverPINVOKE.new_Solver__SWIG_0(name), true) {
245 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending)
throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
256 int size = System.Runtime.InteropServices.Marshal.ReadInt32(dataPointer);
259 var data =
new System.ReadOnlySpan<
byte>((dataPointer +
sizeof(int)).ToPointer(), size);
262 }
catch (
Google.Protobuf.InvalidProtocolBufferException )
264 throw new System.Exception(
"Unable to parse Google.OrTools.ConstraintSolver.ConstraintSolverParameters protocol message.");
272 public SWIGTYPE_p_operations_research__ConstraintSolverParameters
ConstParameters() {
273 SWIGTYPE_p_operations_research__ConstraintSolverParameters ret =
new SWIGTYPE_p_operations_research__ConstraintSolverParameters(operations_research_constraint_solverPINVOKE.Solver_ConstParameters(swigCPtr),
false);
281 int size = System.Runtime.InteropServices.Marshal.ReadInt32(dataPointer);
284 var data =
new System.ReadOnlySpan<
byte>((dataPointer +
sizeof(int)).ToPointer(), size);
287 }
catch (
Google.Protobuf.InvalidProtocolBufferException )
289 throw new System.Exception(
"Unable to parse Google.OrTools.ConstraintSolver.ConstraintSolverParameters protocol message.");
297 public void Add(Constraint c) {
298 operations_research_constraint_solverPINVOKE.Solver_Add(swigCPtr, Constraint.getCPtr(c));
484 public ulong
Stamp() {
510 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
517 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
524 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
531 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
537 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
543 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
549 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
556 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
562 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
569 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
575 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
581 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
587 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
594 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
601 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
608 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
614 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
620 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
626 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
632 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
638 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
644 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
650 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
656 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
662 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
668 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
674 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
680 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
686 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
692 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
698 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
705 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
718 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
725 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
731 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
737 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
743 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
750 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
756 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
762 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
768 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
774 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
780 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
786 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
792 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
823 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
835 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
865 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
871 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
907 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
913 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
949 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
955 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
991 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
997 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1033 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1039 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1206 Demon ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Demon(cPtr, false);
1212 Demon ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Demon(cPtr, false);
1218 Demon ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Demon(cPtr, false);
1242 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1296 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1302 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1616 Pack ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Pack(cPtr, false);
1649 public IntervalVar MakeIntervalVar(
long start_min,
long start_max,
long duration_min,
long duration_max,
long end_min,
long end_max,
bool optional,
string name) {
1656 public void MakeIntervalVarArray(
int count,
long start_min,
long start_max,
long duration_min,
long duration_max,
long end_min,
long end_max,
bool optional,
string name,
IntervalVarVector array) {
1657 operations_research_constraint_solverPINVOKE.
Solver_MakeIntervalVarArray(swigCPtr, count, start_min, start_max, duration_min, duration_max, end_min, end_max, optional, name,
IntervalVarVector.getCPtr(array));
2074 public RegularLimit MakeLimit(SWIGTYPE_p_absl__Duration time,
long branches,
long failures,
long solutions,
bool smart_time_check,
bool cumulative) {
2081 public RegularLimit MakeLimit(SWIGTYPE_p_absl__Duration time,
long branches,
long failures,
long solutions,
bool smart_time_check) {
2088 public RegularLimit MakeLimit(SWIGTYPE_p_absl__Duration time,
long branches,
long failures,
long solutions) {
2101 public RegularLimit MakeLimit(
long time,
long branches,
long failures,
long solutions,
bool smart_time_check,
bool cumulative) {
2107 public RegularLimit MakeLimit(
long time,
long branches,
long failures,
long solutions,
bool smart_time_check) {
2123 int size = System.Runtime.InteropServices.Marshal.ReadInt32(dataPointer);
2126 var data =
new System.ReadOnlySpan<
byte>((dataPointer +
sizeof(int)).ToPointer(), size);
2129 }
catch (
Google.Protobuf.InvalidProtocolBufferException )
2131 throw new System.Exception(
"Unable to parse Google.OrTools.ConstraintSolver.RegularLimitParameters protocol message.");
2139 public SearchLimit
MakeLimit(SearchLimit limit_1, SearchLimit limit_2) {
2140 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.Solver_MakeLimit__SWIG_7(swigCPtr, SearchLimit.getCPtr(limit_1), SearchLimit.getCPtr(limit_2));
2897 public long Rand64(
long size) {
2902 public int Rand32(
int size) {
2907 public void ReSeed(
int seed) {
2961 Demon ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Demon(cPtr, false);
2967 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
2973 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
3051 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);