Google OR-Tools v9.11
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.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
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 FromValues( long[] values) {
79 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_FromValues( values.Length, values ), true);
80 return ret;
81 }
82
83 public static Domain FromIntervals( long[][] intervals) {
85 intervals.GetLength(0),
86 NestedArrayHelper.GetArraySecondSize(intervals),
87 NestedArrayHelper.GetFlatArray(intervals)
88), true);
89 return ret;
90 }
91
92 public static Domain FromFlatIntervals( long[] flat_intervals) {
93 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_FromFlatIntervals( flat_intervals.Length, flat_intervals ), true);
94 return ret;
95 }
96
97 public long[] FlattenedIntervals() {
98 global::System.IntPtr cPtr = operations_research_utilPINVOKE.Domain_FlattenedIntervals(swigCPtr);
99 Int64Vector tmpVector = null;
100 if (cPtr != global::System.IntPtr.Zero) {
101 tmpVector = new Int64Vector(cPtr, true);
102 long[] outArray = new long[tmpVector.Count];
103 tmpVector.CopyTo(outArray);
104 return outArray;
105 }
106 return null;
107}
108
109 public bool IsEmpty() {
110 bool ret = operations_research_utilPINVOKE.Domain_IsEmpty(swigCPtr);
111 return ret;
112 }
113
114 public long Size() {
115 long ret = operations_research_utilPINVOKE.Domain_Size(swigCPtr);
116 return ret;
117 }
118
119 public long Min() {
120 long ret = operations_research_utilPINVOKE.Domain_Min(swigCPtr);
121 return ret;
122 }
123
124 public long Max() {
125 long ret = operations_research_utilPINVOKE.Domain_Max(swigCPtr);
126 return ret;
127 }
128
129 public bool Contains(long value) {
130 bool ret = operations_research_utilPINVOKE.Domain_Contains(swigCPtr, value);
131 return ret;
132 }
133
134 public Domain Complement() {
136 return ret;
137 }
138
139 public Domain Negation() {
141 return ret;
142 }
143
144 public Domain IntersectionWith(Domain domain) {
145 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_IntersectionWith(swigCPtr, Domain.getCPtr(domain)), true);
151 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_UnionWith(swigCPtr, Domain.getCPtr(domain)), true);
157 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_AdditionWith(swigCPtr, Domain.getCPtr(domain)), true);
164 return ret;
165 }
166
167}
168
169}
Domain UnionWith(Domain domain)
Definition Domain.cs:152
bool Contains(long value)
Definition Domain.cs:131
static Domain FromFlatIntervals(long[] flat_intervals)
Definition Domain.cs:94
Domain AdditionWith(Domain domain)
Definition Domain.cs:158
static Domain FromIntervals(long[][] intervals)
Definition Domain.cs:85
static Domain FromValues(long[] values)
Definition Domain.cs:80
Domain IntersectionWith(Domain domain)
Definition Domain.cs:146
long[] FlattenedIntervals()
Definition Domain.cs:99
override string ToString()
Definition Domain.cs:164
static Domain AllValues()
Definition Domain.cs:75
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_AllValues()
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_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)