Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research_constraint_solver.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.3.0
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
13
15 public static long CpRandomSeed() {
17 return ret;
18 }
19
20 public static long Zero() {
22 return ret;
23 }
24
25 public static long One() {
27 return ret;
28 }
29
30 public static void SetAssignmentFromAssignment(Assignment target_assignment, IntVarVector target_vars, Assignment source_assignment, IntVarVector source_vars) {
31 operations_research_constraint_solverPINVOKE.SetAssignmentFromAssignment(Assignment.getCPtr(target_assignment), IntVarVector.getCPtr(target_vars), Assignment.getCPtr(source_assignment), IntVarVector.getCPtr(source_vars));
67 return ret;
68 }
69
70 public static long PosIntDivDown(long e, long v) {
72 return ret;
73 }
74
75 public static long[] ToInt64Vector( int[] input) {
76 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.ToInt64Vector( input.Length, input );
77 Int64Vector tmpVector = null;
78 if (cPtr != global::System.IntPtr.Zero) {
79 tmpVector = new Int64Vector(cPtr, true);
80 long[] outArray = new long[tmpVector.Count];
81 tmpVector.CopyTo(outArray);
82 return outArray;
83 }
84 return null;
85}
86
88 System.IntPtr dataPointer = operations_research_constraint_solverPINVOKE.DefaultRoutingModelParameters();
89 try
90 {
91 int size = System.Runtime.InteropServices.Marshal.ReadInt32(dataPointer);
92 unsafe
93 {
94 var data = new System.ReadOnlySpan<byte>((dataPointer + sizeof(int)).ToPointer(), size);
96 }
97 } catch (Google.Protobuf.InvalidProtocolBufferException /*e*/)
98 {
99 throw new System.Exception("Unable to parse Google.OrTools.ConstraintSolver.RoutingModelParameters protocol message.");
100 }
101 finally
102 {
104 }
105}
106
108 System.IntPtr dataPointer = operations_research_constraint_solverPINVOKE.DefaultRoutingSearchParameters();
109 try
110 {
111 int size = System.Runtime.InteropServices.Marshal.ReadInt32(dataPointer);
112 unsafe
113 {
114 var data = new System.ReadOnlySpan<byte>((dataPointer + sizeof(int)).ToPointer(), size);
116 }
117 } catch (Google.Protobuf.InvalidProtocolBufferException /*e*/)
118 {
119 throw new System.Exception("Unable to parse Google.OrTools.ConstraintSolver.RoutingSearchParameters protocol message.");
120 }
121 finally
122 {
124 }
125}
126
128 System.IntPtr dataPointer = operations_research_constraint_solverPINVOKE.DefaultSecondaryRoutingSearchParameters();
129 try
130 {
131 int size = System.Runtime.InteropServices.Marshal.ReadInt32(dataPointer);
132 unsafe
133 {
134 var data = new System.ReadOnlySpan<byte>((dataPointer + sizeof(int)).ToPointer(), size);
136 }
137 } catch (Google.Protobuf.InvalidProtocolBufferException /*e*/)
138 {
139 throw new System.Exception("Unable to parse Google.OrTools.ConstraintSolver.RoutingSearchParameters protocol message.");
140 }
141 finally
142 {
144 }
145}
146
148 string ret = operations_research_constraint_solverPINVOKE.FindErrorInRoutingSearchParameters(ProtoHelper.ProtoToByteArray(search_parameters, out var buffer), buffer);
149 return ret;
150 }
151
152 public static SWIGTYPE_p_std__vectorT_std__string_t FindErrorsInRoutingSearchParameters(Google.OrTools.ConstraintSolver.RoutingSearchParameters search_parameters) {
153 SWIGTYPE_p_std__vectorT_std__string_t ret = new SWIGTYPE_p_std__vectorT_std__string_t(operations_research_constraint_solverPINVOKE.FindErrorsInRoutingSearchParameters(ProtoHelper.ProtoToByteArray(search_parameters, out var buffer), buffer), true);
154 return ret;
155 }
156
157 public static bool SolveModelWithSat(RoutingModel model, Google.OrTools.ConstraintSolver.RoutingSearchParameters search_parameters, Assignment initial_solution, Assignment solution) {
158 bool ret = operations_research_constraint_solverPINVOKE.SolveModelWithSat(RoutingModel.getCPtr(model), ProtoHelper.ProtoToByteArray(search_parameters, out var buffer), buffer, Assignment.getCPtr(initial_solution), Assignment.getCPtr(solution));
159 return ret;
160 }
161
162 // VarTypes
174
175}
Parameters which have to be set when creating a RoutingModel.
static pb::MessageParser< RoutingModelParameters > Parser
Parameters defining the search used to solve vehicle routing problems.
static pb::MessageParser< RoutingSearchParameters > Parser
static void SetAssignmentFromAssignment(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4)
static long MinVarArray(global::System.Runtime.InteropServices.HandleRef jarg1)
static long MaxVarArray(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr FindErrorsInRoutingSearchParameters(int search_parameters_size, byte[] jarg1)
static bool AreAllBound(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool AreAllBooleans(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr ToInt64Vector(int length1, int[] jarg1)
static bool SolveModelWithSat(global::System.Runtime.InteropServices.HandleRef jarg1, int search_parameters_size, byte[] jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4)
static bool AreAllBoundTo(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static Google.OrTools.ConstraintSolver.RoutingSearchParameters DefaultSecondaryRoutingSearchParameters()
static Google.OrTools.ConstraintSolver.RoutingSearchParameters DefaultRoutingSearchParameters()
static void SetAssignmentFromAssignment(Assignment target_assignment, IntVarVector target_vars, Assignment source_assignment, IntVarVector source_vars)
static string FindErrorInRoutingSearchParameters(Google.OrTools.ConstraintSolver.RoutingSearchParameters search_parameters)
static bool SolveModelWithSat(RoutingModel model, Google.OrTools.ConstraintSolver.RoutingSearchParameters search_parameters, Assignment initial_solution, Assignment solution)
static Google.OrTools.ConstraintSolver.RoutingModelParameters DefaultRoutingModelParameters()
static SWIGTYPE_p_std__vectorT_std__string_t FindErrorsInRoutingSearchParameters(Google.OrTools.ConstraintSolver.RoutingSearchParameters search_parameters)
static void DeleteByteArray(System.IntPtr buffer)
Definition CppBridge.cs:82
static int ProtoToByteArray(IMessage message, out byte[] buffer)