Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
CpSatHelper.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.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
11namespace Google.OrTools.Sat {
12
14
15public class CpSatHelper : global::System.IDisposable {
16 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
17 protected bool swigCMemOwn;
18
19 internal CpSatHelper(global::System.IntPtr cPtr, bool cMemoryOwn) {
20 swigCMemOwn = cMemoryOwn;
21 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
22 }
23
24 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CpSatHelper obj) {
25 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
26 }
27
28 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(CpSatHelper obj) {
29 if (obj != null) {
30 if (!obj.swigCMemOwn)
31 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
32 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
33 obj.swigCMemOwn = false;
34 obj.Dispose();
35 return ptr;
36 } else {
37 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
38 }
39 }
40
41 ~CpSatHelper() {
42 Dispose(false);
43 }
44
45 public void Dispose() {
46 Dispose(true);
47 global::System.GC.SuppressFinalize(this);
48 }
49
50 protected virtual void Dispose(bool disposing) {
51 lock(this) {
52 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
53 if (swigCMemOwn) {
54 swigCMemOwn = false;
56 }
57 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
58 }
59 }
60 }
61
62 public static string ModelStats(Google.OrTools.Sat.CpModelProto model_proto) {
63 string ret = operations_research_satPINVOKE.CpSatHelper_ModelStats(ProtoHelper.ProtoToByteArray(model_proto, out var buffer), buffer);
64 return ret;
65 }
66
67 public static string SolverResponseStats(Google.OrTools.Sat.CpSolverResponse response) {
69 return ret;
70 }
71
72 public static string ValidateModel(Google.OrTools.Sat.CpModelProto model_proto) {
73 string ret = operations_research_satPINVOKE.CpSatHelper_ValidateModel(ProtoHelper.ProtoToByteArray(model_proto, out var buffer), buffer);
74 return ret;
75 }
76
77 public static Domain VariableDomain(Google.OrTools.Sat.IntegerVariableProto variable_proto) {
78 Domain ret = new Domain(operations_research_satPINVOKE.CpSatHelper_VariableDomain(ProtoHelper.ProtoToByteArray(variable_proto, out var buffer), buffer), true);
79 return ret;
80 }
81
82 public static bool WriteModelToFile(Google.OrTools.Sat.CpModelProto model_proto, string filename) {
83 bool ret = operations_research_satPINVOKE.CpSatHelper_WriteModelToFile(ProtoHelper.ProtoToByteArray(model_proto, out var buffer), buffer, filename);
89 }
91}
92
93}
static int ProtoToByteArray(IMessage message, out byte[] buffer)
A constraint programming problem.
static string ModelStats(Google.OrTools.Sat.CpModelProto model_proto)
static Domain VariableDomain(Google.OrTools.Sat.IntegerVariableProto variable_proto)
static string SolverResponseStats(Google.OrTools.Sat.CpSolverResponse response)
static string ValidateModel(Google.OrTools.Sat.CpModelProto model_proto)
static bool WriteModelToFile(Google.OrTools.Sat.CpModelProto model_proto, string filename)
The response returned by a solver trying to solve a CpModelProto.
static bool CpSatHelper_WriteModelToFile(int model_proto_size, byte[] jarg1, string jarg2)
static string CpSatHelper_ValidateModel(int model_proto_size, byte[] jarg1)
static void delete_CpSatHelper(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr CpSatHelper_VariableDomain(int variable_proto_size, byte[] jarg1)
static string CpSatHelper_SolverResponseStats(int response_size, byte[] jarg1)