Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Domain.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.4.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.Util {
12
13using System;
14using System.Runtime.InteropServices;
15using System.Collections;
16
17public partial 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 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(Domain obj) {
31 if (obj != null) {
32 if (!obj.swigCMemOwn)
33 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
34 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
35 obj.swigCMemOwn = false;
36 obj.Dispose();
37 return ptr;
38 } else {
39 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
40 }
41 }
42
43 ~Domain() {
44 Dispose(false);
45 }
46
47 public void Dispose() {
48 Dispose(true);
49 global::System.GC.SuppressFinalize(this);
50 }
51
52 protected virtual void Dispose(bool disposing) {
53 lock(this) {
54 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
55 if (swigCMemOwn) {
56 swigCMemOwn = false;
58 }
59 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
60 }
61 }
62 }
63
64 public Domain() : this(operations_research_utilPINVOKE.new_Domain__SWIG_0(), true) {
65 }
67 public Domain(long value) : this(operations_research_utilPINVOKE.new_Domain__SWIG_1(value), true) {
68 }
70 public Domain(long left, long right) : this(operations_research_utilPINVOKE.new_Domain__SWIG_2(left, right), true) {
71 }
73 public static Domain AllValues() {
75 return ret;
76 }
77
78 public static Domain LowerOrEqual(long value) {
80 return ret;
81 }
82
83 public static Domain GreaterOrEqual(long value) {
85 return ret;
86 }
87
88 public static Domain FromValues( long[] values) {
89 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_FromValues( values.Length, values ), true);
90 return ret;
91 }
92
93 public static Domain FromIntervals( long[][] intervals) {
95 intervals.GetLength(0),
96 NestedArrayHelper.GetArraySecondSize(intervals),
97 NestedArrayHelper.GetFlatArray(intervals)
98), true);
99 return ret;
100 }
101
102 public static Domain FromFlatIntervals( long[] flat_intervals) {
103 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_FromFlatIntervals( flat_intervals.Length, flat_intervals ), true);
104 return ret;
105 }
106
107 public long[] FlattenedIntervals() {
108 global::System.IntPtr cPtr = operations_research_utilPINVOKE.Domain_FlattenedIntervals(swigCPtr);
109 Int64Vector tmpVector = null;
110 if (cPtr != global::System.IntPtr.Zero) {
111 tmpVector = new Int64Vector(cPtr, true);
112 long[] outArray = new long[tmpVector.Count];
113 tmpVector.CopyTo(outArray);
114 return outArray;
115 }
116 return null;
117}
118
119 public bool IsEmpty() {
120 bool ret = operations_research_utilPINVOKE.Domain_IsEmpty(swigCPtr);
121 return ret;
122 }
123
124 public long Size() {
125 long ret = operations_research_utilPINVOKE.Domain_Size(swigCPtr);
126 return ret;
127 }
128
129 public long Min() {
130 long ret = operations_research_utilPINVOKE.Domain_Min(swigCPtr);
131 return ret;
132 }
133
134 public long Max() {
135 long ret = operations_research_utilPINVOKE.Domain_Max(swigCPtr);
136 return ret;
137 }
138
139 public bool Contains(long value) {
140 bool ret = operations_research_utilPINVOKE.Domain_Contains(swigCPtr, value);
141 return ret;
142 }
143
144 public bool IsIncludedIn(Domain domain) {
145 bool ret = operations_research_utilPINVOKE.Domain_IsIncludedIn(swigCPtr, Domain.getCPtr(domain));
151 bool ret = operations_research_utilPINVOKE.Domain_OverlapsWith(swigCPtr, Domain.getCPtr(domain));
158 return ret;
159 }
160
161 public Domain Negation() {
163 return ret;
164 }
165
166 public Domain IntersectionWith(Domain domain) {
167 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_IntersectionWith(swigCPtr, Domain.getCPtr(domain)), true);
173 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_UnionWith(swigCPtr, Domain.getCPtr(domain)), true);
179 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_AdditionWith(swigCPtr, Domain.getCPtr(domain)), true);
186 return ret;
187 }
188
189}
190
191}
Domain UnionWith(Domain domain)
Definition Domain.cs:174
static Domain LowerOrEqual(long value)
Definition Domain.cs:80
bool Contains(long value)
Definition Domain.cs:141
static Domain FromFlatIntervals(long[] flat_intervals)
Definition Domain.cs:104
Domain AdditionWith(Domain domain)
Definition Domain.cs:180
static Domain FromIntervals(long[][] intervals)
Definition Domain.cs:95
static Domain FromValues(long[] values)
Definition Domain.cs:90
Domain IntersectionWith(Domain domain)
Definition Domain.cs:168
static Domain GreaterOrEqual(long value)
Definition Domain.cs:85
override string ToString()
Definition Domain.cs:186
bool OverlapsWith(Domain domain)
Definition Domain.cs:152
static Domain AllValues()
Definition Domain.cs:75
bool IsIncludedIn(Domain domain)
Definition Domain.cs:146
static bool Domain_IsIncludedIn(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static long Domain_Size(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Domain_FromValues(int length1, long[] jarg1)
static long Domain_Max(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Domain_AdditionWith(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static string Domain_ToString(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_Domain(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Domain_Negation(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Domain_FromIntervals(int len1_1, int[] len1_2, long[] jarg1)
static global::System.IntPtr Domain_UnionWith(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr Domain_IntersectionWith(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr Domain_Complement(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Domain_FromFlatIntervals(int length1, long[] jarg1)
static global::System.IntPtr Domain_LowerOrEqual(long jarg1)
static global::System.IntPtr Domain_AllValues()
static global::System.IntPtr Domain_GreaterOrEqual(long jarg1)
static global::System.IntPtr Domain_FlattenedIntervals(global::System.Runtime.InteropServices.HandleRef jarg1)
static long Domain_Min(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool Domain_OverlapsWith(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static bool Domain_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)