DotNet Reference

DotNet Reference

sat/Domain.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 3.0.12
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 System;
14 using System.Runtime.InteropServices;
15 using System.Collections;
16 
17 public class Domain : global::System.IDisposable {
18  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19  protected bool swigCMemOwn;
20 
21  internal Domain(global::System.IntPtr cPtr, bool cMemoryOwn) {
22  swigCMemOwn = cMemoryOwn;
23  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24  }
25 
26  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Domain obj) {
27  return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
28  }
29 
30  ~Domain() {
31  Dispose();
32  }
33 
34  public virtual void Dispose() {
35  lock(this) {
36  if (swigCPtr.Handle != global::System.IntPtr.Zero) {
37  if (swigCMemOwn) {
38  swigCMemOwn = false;
40  }
41  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
42  }
43  global::System.GC.SuppressFinalize(this);
44  }
45  }
46 
47  public Domain() : this(operations_research_satPINVOKE.new_Domain__SWIG_0(), true) {
48  }
49 
50  public Domain(long value) : this(operations_research_satPINVOKE.new_Domain__SWIG_1(value), true) {
51  }
52 
53  public Domain(long left, long right) : this(operations_research_satPINVOKE.new_Domain__SWIG_2(left, right), true) {
54  }
55 
56  public static Domain AllValues() {
58  return ret;
59  }
60 
61  public static Domain FromValues( long[] values) {
62  Domain ret = new Domain(operations_research_satPINVOKE.Domain_FromValues( values.Length, values ), true);
63  return ret;
64  }
65 
66  public static Domain FromIntervals( long[][] intervals) {
68  intervals.GetLength(0),
69  NestedArrayHelper.GetArraySecondSize(intervals),
70  NestedArrayHelper.GetFlatArray(intervals)
71 ), true);
72  return ret;
73  }
74 
75  public static Domain FromFlatIntervals( long[] flat_intervals) {
76  Domain ret = new Domain(operations_research_satPINVOKE.Domain_FromFlatIntervals( flat_intervals.Length, flat_intervals ), true);
77  return ret;
78  }
79 
80  public long[] FlattenedIntervals() {
81  global::System.IntPtr cPtr = operations_research_satPINVOKE.Domain_FlattenedIntervals(swigCPtr);
82  UtilInt64Vector tmpVector = null;
83  if (cPtr != global::System.IntPtr.Zero) {
84  tmpVector = new UtilInt64Vector(cPtr, true);
85  long[] outArray = new long[tmpVector.Count];
86  tmpVector.CopyTo(outArray);
87  return outArray;
88  }
89  return null;
90 }
91 
92  public bool IsEmpty() {
94  return ret;
95  }
96 
97  public long Size() {
98  long ret = operations_research_satPINVOKE.Domain_Size(swigCPtr);
99  return ret;
100  }
101 
102  public long Min() {
103  long ret = operations_research_satPINVOKE.Domain_Min(swigCPtr);
104  return ret;
105  }
106 
107  public long Max() {
108  long ret = operations_research_satPINVOKE.Domain_Max(swigCPtr);
109  return ret;
110  }
111 
112  public bool Contains(long value) {
113  bool ret = operations_research_satPINVOKE.Domain_Contains(swigCPtr, value);
114  return ret;
115  }
116 
117  public Domain Complement() {
119  return ret;
120  }
121 
122  public Domain Negation() {
123  Domain ret = new Domain(operations_research_satPINVOKE.Domain_Negation(swigCPtr), true);
124  return ret;
125  }
126 
127  public Domain IntersectionWith(Domain domain) {
128  Domain ret = new Domain(operations_research_satPINVOKE.Domain_IntersectionWith(swigCPtr, Domain.getCPtr(domain)), true);
130  return ret;
131  }
132 
133  public Domain UnionWith(Domain domain) {
134  Domain ret = new Domain(operations_research_satPINVOKE.Domain_UnionWith(swigCPtr, Domain.getCPtr(domain)), true);
136  return ret;
137  }
138 
139  public Domain AdditionWith(Domain domain) {
140  Domain ret = new Domain(operations_research_satPINVOKE.Domain_AdditionWith(swigCPtr, Domain.getCPtr(domain)), true);
142  return ret;
143  }
144 
145  public string ToString() {
146  string ret = operations_research_satPINVOKE.Domain_ToString(swigCPtr);
147  return ret;
148  }
149 
150 }
151 
152 }
static global::System.Exception Retrieve()
static global::System.IntPtr Domain_FromValues(int length1, long[] jarg1)
static global::System.IntPtr Domain_AllValues()
virtual void Dispose()
Definition: sat/Domain.cs:34
int Count
Domain UnionWith(Domain domain)
Definition: sat/Domain.cs:133
static bool Pending
static global::System.IntPtr Domain_IntersectionWith(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
string ToString()
Definition: sat/Domain.cs:145
static long Domain_Max(global::System.Runtime.InteropServices.HandleRef jarg1)
Definition: sat/Domain.cs:17
bool IsEmpty()
Definition: sat/Domain.cs:92
static void delete_Domain(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Domain_AdditionWith(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
long[] FlattenedIntervals()
Definition: sat/Domain.cs:80
long Max()
Definition: sat/Domain.cs:107
Domain AdditionWith(Domain domain)
Definition: sat/Domain.cs:139
static bool Domain_IsEmpty(global::System.Runtime.InteropServices.HandleRef jarg1)
Domain(long left, long right)
Definition: sat/Domain.cs:53
static Domain FromIntervals(long[][] intervals)
Definition: sat/Domain.cs:66
Domain Negation()
Definition: sat/Domain.cs:122
static string Domain_ToString(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Domain_Complement(global::System.Runtime.InteropServices.HandleRef jarg1)
static Domain AllValues()
Definition: sat/Domain.cs:56
static global::System.IntPtr Domain_FromFlatIntervals(int length1, long[] jarg1)
static long Domain_Min(global::System.Runtime.InteropServices.HandleRef jarg1)
long Min()
Definition: sat/Domain.cs:102
static global::System.IntPtr Domain_UnionWith(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
Domain IntersectionWith(Domain domain)
Definition: sat/Domain.cs:127
Domain Complement()
Definition: sat/Domain.cs:117
bool Contains(long value)
Definition: sat/Domain.cs:112
static global::System.IntPtr Domain_Negation(global::System.Runtime.InteropServices.HandleRef jarg1)
bool swigCMemOwn
Definition: sat/Domain.cs:19
Domain()
Definition: sat/Domain.cs:47
static Domain FromFlatIntervals(long[] flat_intervals)
Definition: sat/Domain.cs:75
long Size()
Definition: sat/Domain.cs:97
void CopyTo(long[] array)
static long Domain_Size(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool Domain_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static Domain FromValues(long[] values)
Definition: sat/Domain.cs:61
static global::System.IntPtr Domain_FlattenedIntervals(global::System.Runtime.InteropServices.HandleRef jarg1)
Domain(long value)
Definition: sat/Domain.cs:50
static global::System.IntPtr Domain_FromIntervals(int len1_1, int[] len1_2, long[] jarg1)
Definition: CpModel.pb.cs:12