Google OR-Tools v9.11
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.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
13public class operations_research_constraint_solver {
14 public static long CpRandomSeed() {
16 return ret;
17 }
18
19 public static long Zero() {
21 return ret;
22 }
23
24 public static long One() {
26 return ret;
27 }
28
29 public static void SetAssignmentFromAssignment(Assignment target_assignment, IntVarVector target_vars, Assignment source_assignment, IntVarVector source_vars) {
30 operations_research_constraint_solverPINVOKE.SetAssignmentFromAssignment(Assignment.getCPtr(target_assignment), IntVarVector.getCPtr(target_vars), Assignment.getCPtr(source_assignment), IntVarVector.getCPtr(source_vars));
66 return ret;
67 }
68
69 public static long PosIntDivDown(long e, long v) {
71 return ret;
72 }
73
74 public static long[] ToInt64Vector( int[] input) {
75 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.ToInt64Vector( input.Length, input );
76 Int64Vector tmpVector = null;
77 if (cPtr != global::System.IntPtr.Zero) {
78 tmpVector = new Int64Vector(cPtr, true);
79 long[] outArray = new long[tmpVector.Count];
80 tmpVector.CopyTo(outArray);
81 return outArray;
82 }
83 return null;
84}
85
87 System.IntPtr dataPointer = operations_research_constraint_solverPINVOKE.DefaultRoutingModelParameters();
88 try
89 {
90 int size = System.Runtime.InteropServices.Marshal.ReadInt32(dataPointer);
91 unsafe
92 {
93 var data = new System.ReadOnlySpan<byte>((dataPointer + sizeof(int)).ToPointer(), size);
95 }
96 } catch (Google.Protobuf.InvalidProtocolBufferException /*e*/)
97 {
98 throw new System.Exception("Unable to parse Google.OrTools.ConstraintSolver.RoutingModelParameters protocol message.");
99 }
100 finally
101 {
103 }
104}
105
107 System.IntPtr dataPointer = operations_research_constraint_solverPINVOKE.DefaultRoutingSearchParameters();
108 try
109 {
110 int size = System.Runtime.InteropServices.Marshal.ReadInt32(dataPointer);
111 unsafe
112 {
113 var data = new System.ReadOnlySpan<byte>((dataPointer + sizeof(int)).ToPointer(), size);
115 }
116 } catch (Google.Protobuf.InvalidProtocolBufferException /*e*/)
117 {
118 throw new System.Exception("Unable to parse Google.OrTools.ConstraintSolver.RoutingSearchParameters protocol message.");
119 }
120 finally
121 {
123 }
124}
125
127 System.IntPtr dataPointer = operations_research_constraint_solverPINVOKE.DefaultSecondaryRoutingSearchParameters();
128 try
129 {
130 int size = System.Runtime.InteropServices.Marshal.ReadInt32(dataPointer);
131 unsafe
132 {
133 var data = new System.ReadOnlySpan<byte>((dataPointer + sizeof(int)).ToPointer(), size);
135 }
136 } catch (Google.Protobuf.InvalidProtocolBufferException /*e*/)
137 {
138 throw new System.Exception("Unable to parse Google.OrTools.ConstraintSolver.RoutingSearchParameters protocol message.");
139 }
140 finally
141 {
143 }
144}
145
147 string ret = operations_research_constraint_solverPINVOKE.FindErrorInRoutingSearchParameters(ProtoHelper.ProtoToByteArray(search_parameters, out var buffer), buffer);
148 return ret;
149 }
150
151 public static SWIGTYPE_p_std__vectorT_std__string_t FindErrorsInRoutingSearchParameters(Google.OrTools.ConstraintSolver.RoutingSearchParameters search_parameters) {
152 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);
153 return ret;
154 }
155
156 public static bool SolveModelWithSat(RoutingModel model, Google.OrTools.ConstraintSolver.RoutingSearchParameters search_parameters, Assignment initial_solution, Assignment solution) {
157 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));
158 return ret;
159 }
160
161 // VarTypes
173
174}
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)