Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Pack.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 Pack : Constraint {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal Pack(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.Pack_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Pack 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(Pack 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 // Store list of delegates to avoid the GC to reclaim them.
56 private List<LongToLong> LongToLongCallbacks;
57 private List<LongLongToLong> LongLongToLongCallbacks;
58 // Ensure that the GC does not collect any IndexEvaluator1Callback set from C#
59 // as the underlying C++ class will only store a pointer to it (i.e. no ownership).
60 private LongToLong StoreLongToLong(LongToLong c) {
61 if (LongToLongCallbacks == null)
62 LongToLongCallbacks = new List<LongToLong>();
63 LongToLongCallbacks.Add(c);
64 return c;
65 }
66 private LongLongToLong StoreLongLongToLong(LongLongToLong c) {
67 if (LongLongToLongCallbacks == null)
68 LongLongToLongCallbacks = new List<LongLongToLong>();
69 LongLongToLongCallbacks.Add(c);
70 return c;
71 }
72
73 public Pack(Solver s, IntVarVector vars, int number_of_bins) : this(operations_research_constraint_solverPINVOKE.new_Pack(Solver.getCPtr(s), IntVarVector.getCPtr(vars), number_of_bins), true) {
74 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
75 }
76
77 public void AddWeightedSumLessOrEqualConstantDimension( long[] weights, long[] bounds) {
78 operations_research_constraint_solverPINVOKE.Pack_AddWeightedSumLessOrEqualConstantDimension__SWIG_0(swigCPtr, weights.Length, weights , bounds.Length, bounds );
79 }
80
81 public void AddWeightedSumLessOrEqualConstantDimension( LongToLong weights, long[] bounds) {
82 operations_research_constraint_solverPINVOKE.Pack_AddWeightedSumLessOrEqualConstantDimension__SWIG_1(swigCPtr, StoreLongToLong(weights) , bounds.Length, bounds );
83 }
84
85 public void AddWeightedSumLessOrEqualConstantDimension( LongLongToLong weights, long[] bounds) {
86 operations_research_constraint_solverPINVOKE.Pack_AddWeightedSumLessOrEqualConstantDimension__SWIG_2(swigCPtr, StoreLongLongToLong(weights) , bounds.Length, bounds );
87 }
88
89 public void AddWeightedSumEqualVarDimension( long[] weights, IntVarVector loads) {
105 operations_research_constraint_solverPINVOKE.Pack_AddWeightedSumOfAssignedDimension(swigCPtr, weights.Length, weights , IntVar.getCPtr(cost_var));
107
108 public void AddCountUsedBinDimension(IntVar count_var) {
111
112 public void AddCountAssignedItemsDimension(IntVar count_var) {
115
116 public override void Post() {
119
120 public void ClearAll() {
123
124 public void PropagateDelayed() {
127
128 public override void InitialPropagateWrapper() {
131
132 public void Propagate() {
135
136 public void OneDomain(int var_index) {
139
140 public override string ToString() {
142 return ret;
143 }
144
145 public bool IsUndecided(int var_index, int bin_index) {
146 bool ret = operations_research_constraint_solverPINVOKE.Pack_IsUndecided(swigCPtr, var_index, bin_index);
147 return ret;
148 }
149
150 public void SetImpossible(int var_index, int bin_index) {
153
154 public void Assign(int var_index, int bin_index) {
155 operations_research_constraint_solverPINVOKE.Pack_Assign(swigCPtr, var_index, bin_index);
157
158 public bool IsAssignedStatusKnown(int var_index) {
160 return ret;
161 }
162
163 public bool IsPossible(int var_index, int bin_index) {
164 bool ret = operations_research_constraint_solverPINVOKE.Pack_IsPossible(swigCPtr, var_index, bin_index);
165 return ret;
166 }
167
168 public IntVar AssignVar(int var_index, int bin_index) {
169 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.Pack_AssignVar(swigCPtr, var_index, bin_index);
170 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
171 return ret;
172 }
173
174 public void SetAssigned(int var_index) {
177
178 public void SetUnassigned(int var_index) {
181
182 public void RemoveAllPossibleFromBin(int bin_index) {
185
186 public void AssignAllPossibleToBin(int bin_index) {
189
190 public void AssignFirstPossibleToBin(int bin_index) {
193
194 public void AssignAllRemainingItems() {
197
198 public void UnassignAllRemainingItems() {
201
202 public override void Accept(ModelVisitor visitor) {
205
206}
207
208}
void AssignAllPossibleToBin(int bin_index)
Definition Pack.cs:188
void RemoveAllPossibleFromBin(int bin_index)
Definition Pack.cs:184
override void Accept(ModelVisitor visitor)
Definition Pack.cs:204
void SetImpossible(int var_index, int bin_index)
Definition Pack.cs:152
override void InitialPropagateWrapper()
Definition Pack.cs:130
void AddCountUsedBinDimension(IntVar count_var)
Definition Pack.cs:110
void AddSumVariableWeightsLessOrEqualConstantDimension(IntVarVector usage, long[] capacity)
Definition Pack.cs:101
bool IsAssignedStatusKnown(int var_index)
Definition Pack.cs:160
void SetUnassigned(int var_index)
Definition Pack.cs:180
void AddCountAssignedItemsDimension(IntVar count_var)
Definition Pack.cs:114
void Assign(int var_index, int bin_index)
Definition Pack.cs:156
void AddWeightedSumEqualVarDimension(long[] weights, IntVarVector loads)
Definition Pack.cs:91
void AddWeightedSumLessOrEqualConstantDimension(long[] weights, long[] bounds)
Definition Pack.cs:79
void AddWeightedSumOfAssignedDimension(long[] weights, IntVar cost_var)
Definition Pack.cs:106
bool IsPossible(int var_index, int bin_index)
Definition Pack.cs:165
void SetAssigned(int var_index)
Definition Pack.cs:176
void OneDomain(int var_index)
Definition Pack.cs:138
void AssignFirstPossibleToBin(int bin_index)
Definition Pack.cs:192
IntVar AssignVar(int var_index, int bin_index)
Definition Pack.cs:170
bool IsUndecided(int var_index, int bin_index)
Definition Pack.cs:147
static void Pack_AddSumVariableWeightsLessOrEqualConstantDimension(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int length3, long[] jarg3)
static bool Pack_IsAssignedStatusKnown(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void Pack_AddWeightedSumEqualVarDimension__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, long[] jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static string Pack_ToString(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Pack_RemoveAllPossibleFromBin(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void Pack_AssignAllPossibleToBin(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void Pack_SetUnassigned(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void Pack_AddCountUsedBinDimension(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void Pack_PropagateDelayed(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Pack_AssignVar(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void Pack_InitialPropagateWrapper(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Pack_AddWeightedSumLessOrEqualConstantDimension__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, long[] jarg2, int length3, long[] jarg3)
static void Pack_AddWeightedSumEqualVarDimension__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, LongLongToLong jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void delete_Pack(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Pack_UnassignAllRemainingItems(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Pack_Post(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Pack_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static bool Pack_IsPossible(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void Pack_ClearAll(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Pack_AddWeightedSumOfAssignedDimension(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, long[] jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void Pack_AddCountAssignedItemsDimension(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void Pack_AddWeightedSumLessOrEqualConstantDimension__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1, LongLongToLong jarg2, int length3, long[] jarg3)
static void Pack_AssignFirstPossibleToBin(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void Pack_Propagate(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Pack_AddWeightedSumLessOrEqualConstantDimension__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, LongToLong jarg2, int length3, long[] jarg3)
static void Pack_SetAssigned(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void Pack_Accept(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static bool Pack_IsUndecided(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void Pack_OneDomain(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void Pack_AssignAllRemainingItems(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Pack_SetImpossible(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
delegate long LongLongToLong(long t, long u)
Used to wrap IndexEvaluator2 (std::function<int64_t(int64_t, int64_t)>)
delegate long LongToLong(long t)
Used to wrap IndexEvaluator1 (std::function<int64_t(int64_t)>)