14using System.Runtime.InteropServices;
15using System.Collections;
16using System.Collections.Generic;
18public partial class Solver : global::System.IDisposable {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
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);
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() {
519 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
526 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
533 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
540 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
546 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
552 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
558 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
565 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
571 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
578 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
584 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
590 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
596 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
603 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
610 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
617 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
623 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
629 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
635 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
641 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
647 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
653 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
659 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
665 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
671 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
677 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
683 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
689 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
695 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
701 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
707 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
714 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
727 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
734 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
740 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
746 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
752 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
759 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
765 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
771 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
777 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
783 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
789 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
795 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
801 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
832 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
844 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
874 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
880 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
916 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
922 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
958 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
964 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1000 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1006 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1042 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1048 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1215 Demon ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Demon(cPtr, false);
1221 Demon ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Demon(cPtr, false);
1227 Demon ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Demon(cPtr, false);
1251 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1305 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1311 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
1625 Pack ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Pack(cPtr, false);
1658 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) {
1665 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) {
1666 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));
2062 public RegularLimit MakeLimit(SWIGTYPE_p_absl__Duration time,
long branches,
long failures,
long solutions,
bool smart_time_check,
bool cumulative) {
2069 public RegularLimit MakeLimit(SWIGTYPE_p_absl__Duration time,
long branches,
long failures,
long solutions,
bool smart_time_check) {
2076 public RegularLimit MakeLimit(SWIGTYPE_p_absl__Duration time,
long branches,
long failures,
long solutions) {
2089 public RegularLimit MakeLimit(
long time,
long branches,
long failures,
long solutions,
bool smart_time_check,
bool cumulative) {
2095 public RegularLimit MakeLimit(
long time,
long branches,
long failures,
long solutions,
bool smart_time_check) {
2111 int size = System.Runtime.InteropServices.Marshal.ReadInt32(dataPointer);
2114 var data =
new System.ReadOnlySpan<
byte>((dataPointer +
sizeof(int)).ToPointer(), size);
2117 }
catch (
Google.Protobuf.InvalidProtocolBufferException )
2119 throw new System.Exception(
"Unable to parse Google.OrTools.ConstraintSolver.RegularLimitParameters protocol message.");
2127 public SearchLimit
MakeLimit(SearchLimit limit_1, SearchLimit limit_2) {
2128 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.Solver_MakeLimit__SWIG_7(swigCPtr, SearchLimit.getCPtr(limit_1), SearchLimit.getCPtr(limit_2));
2620 public LocalSearchOperator MakeOperator(
IntVarVector vars,
int op, SWIGTYPE_p_std__functionT_std__vectorT_int_t_const_Rfint_intF_t get_incoming_neighbors, SWIGTYPE_p_std__functionT_std__vectorT_int_t_const_Rfint_intF_t get_outgoing_neighbors) {
2641 public LocalSearchOperator MakeOperator(
IntVarVector vars,
IntVarVector secondary_vars,
int op, SWIGTYPE_p_std__functionT_std__vectorT_int_t_const_Rfint_intF_t get_incoming_neighbors, SWIGTYPE_p_std__functionT_std__vectorT_int_t_const_Rfint_intF_t get_outgoing_neighbors) {
2899 public long Rand64(
long size) {
2904 public int Rand32(
int size) {
2909 public void ReSeed(
int seed) {
2963 Demon ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Demon(cPtr, false);
2969 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);
2975 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
3053 IntExpr ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntExpr(cPtr, false);