DotNet Reference

.Net Reference

CpSatHelper.cs
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 4.0.2
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 
11 namespace Google.OrTools.Sat {
12 
13 using Google.OrTools.Util;
14 
15 public 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  ~CpSatHelper() {
29  Dispose(false);
30  }
31 
32  public void Dispose() {
33  Dispose(true);
34  global::System.GC.SuppressFinalize(this);
35  }
36 
37  protected virtual void Dispose(bool disposing) {
38  lock(this) {
39  if (swigCPtr.Handle != global::System.IntPtr.Zero) {
40  if (swigCMemOwn) {
41  swigCMemOwn = false;
43  }
44  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
45  }
46  }
47  }
48 
49  public static string ModelStats(Google.OrTools.Sat.CpModelProto model_proto) {
50  string ret = operations_research_satPINVOKE.CpSatHelper_ModelStats(model_proto.CalculateSize(), ProtoHelper.ProtoToByteArray(model_proto));
51  return ret;
52  }
53 
54  public static string SolverResponseStats(Google.OrTools.Sat.CpSolverResponse response) {
55  string ret = operations_research_satPINVOKE.CpSatHelper_SolverResponseStats(response.CalculateSize(), ProtoHelper.ProtoToByteArray(response));
56  return ret;
57  }
58 
59  public static string ValidateModel(Google.OrTools.Sat.CpModelProto model_proto) {
60  string ret = operations_research_satPINVOKE.CpSatHelper_ValidateModel(model_proto.CalculateSize(), ProtoHelper.ProtoToByteArray(model_proto));
61  return ret;
62  }
63 
64  public static Domain VariableDomain(Google.OrTools.Sat.IntegerVariableProto variable_proto) {
65  Domain ret = new Domain(operations_research_satPINVOKE.CpSatHelper_VariableDomain(variable_proto.CalculateSize(), ProtoHelper.ProtoToByteArray(variable_proto)), true);
66  return ret;
67  }
68 
69  public static bool WriteModelToFile(Google.OrTools.Sat.CpModelProto model_proto, string filename) {
70  bool ret = operations_research_satPINVOKE.CpSatHelper_WriteModelToFile(model_proto.CalculateSize(), ProtoHelper.ProtoToByteArray(model_proto), filename);
72  return ret;
73  }
74 
75  public CpSatHelper() : this(operations_research_satPINVOKE.new_CpSatHelper(), true) {
76  }
77 
78 }
79 
80 }
static byte[] ProtoToByteArray(IMessage message)
Definition: ProtoHelper.cs:22
A constraint programming problem.
Definition: CpModel.pb.cs:7952
static string ValidateModel(Google.OrTools.Sat.CpModelProto model_proto)
Definition: CpSatHelper.cs:59
virtual void Dispose(bool disposing)
Definition: CpSatHelper.cs:37
static string SolverResponseStats(Google.OrTools.Sat.CpSolverResponse response)
Definition: CpSatHelper.cs:54
static bool WriteModelToFile(Google.OrTools.Sat.CpModelProto model_proto, string filename)
Definition: CpSatHelper.cs:69
static Domain VariableDomain(Google.OrTools.Sat.IntegerVariableProto variable_proto)
Definition: CpSatHelper.cs:64
static string ModelStats(Google.OrTools.Sat.CpModelProto model_proto)
Definition: CpSatHelper.cs:49
The response returned by a solver trying to solve a CpModelProto.
Definition: CpModel.pb.cs:8424
static string CpSatHelper_ModelStats(int model_proto_size, byte[] jarg1)
static global::System.IntPtr CpSatHelper_VariableDomain(int variable_proto_size, byte[] jarg1)
static void delete_CpSatHelper(global::System.Runtime.InteropServices.HandleRef jarg1)
static string CpSatHelper_SolverResponseStats(int response_size, byte[] jarg1)
static bool CpSatHelper_WriteModelToFile(int model_proto_size, byte[] jarg1, string jarg2)
static string CpSatHelper_ValidateModel(int model_proto_size, byte[] jarg1)