DotNet Reference

.Net Reference

util/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 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
12
13using System;
14using System.Runtime.InteropServices;
15using System.Collections;
16
17public 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(false);
32 }
33
34 public void Dispose() {
35 Dispose(true);
36 global::System.GC.SuppressFinalize(this);
37 }
38
39 protected virtual void Dispose(bool disposing) {
40 lock(this) {
41 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
42 if (swigCMemOwn) {
43 swigCMemOwn = false;
45 }
46 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
47 }
48 }
49 }
50
51 public Domain() : this(operations_research_utilPINVOKE.new_Domain__SWIG_0(), true) {
52 }
53
54 public Domain(long value) : this(operations_research_utilPINVOKE.new_Domain__SWIG_1(value), true) {
55 }
56
57 public Domain(long left, long right) : this(operations_research_utilPINVOKE.new_Domain__SWIG_2(left, right), true) {
58 }
59
60 public static Domain AllValues() {
62 return ret;
63 }
64
65 public static Domain FromValues( long[] values) {
66 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_FromValues( values.Length, values ), true);
67 return ret;
68 }
69
70 public static Domain FromIntervals( long[][] intervals) {
72 intervals.GetLength(0),
73 NestedArrayHelper.GetArraySecondSize(intervals),
74 NestedArrayHelper.GetFlatArray(intervals)
75), true);
76 return ret;
77 }
78
79 public static Domain FromFlatIntervals( long[] flat_intervals) {
80 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_FromFlatIntervals( flat_intervals.Length, flat_intervals ), true);
81 return ret;
82 }
83
84 public long[] FlattenedIntervals() {
85 global::System.IntPtr cPtr = operations_research_utilPINVOKE.Domain_FlattenedIntervals(swigCPtr);
86 Int64Vector tmpVector = null;
87 if (cPtr != global::System.IntPtr.Zero) {
88 tmpVector = new Int64Vector(cPtr, true);
89 long[] outArray = new long[tmpVector.Count];
90 tmpVector.CopyTo(outArray);
91 return outArray;
92 }
93 return null;
94}
95
96 public bool IsEmpty() {
98 return ret;
99 }
100
101 public long Size() {
102 long ret = operations_research_utilPINVOKE.Domain_Size(swigCPtr);
103 return ret;
104 }
105
106 public long Min() {
107 long ret = operations_research_utilPINVOKE.Domain_Min(swigCPtr);
108 return ret;
109 }
110
111 public long Max() {
112 long ret = operations_research_utilPINVOKE.Domain_Max(swigCPtr);
113 return ret;
114 }
115
116 public bool Contains(long value) {
117 bool ret = operations_research_utilPINVOKE.Domain_Contains(swigCPtr, value);
118 return ret;
119 }
120
123 return ret;
124 }
125
126 public Domain Negation() {
128 return ret;
129 }
130
132 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_IntersectionWith(swigCPtr, Domain.getCPtr(domain)), true);
134 return ret;
135 }
136
137 public Domain UnionWith(Domain domain) {
138 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_UnionWith(swigCPtr, Domain.getCPtr(domain)), true);
140 return ret;
141 }
142
143 public Domain AdditionWith(Domain domain) {
144 Domain ret = new Domain(operations_research_utilPINVOKE.Domain_AdditionWith(swigCPtr, Domain.getCPtr(domain)), true);
146 return ret;
147 }
148
149 public override string ToString() {
151 return ret;
152 }
153
154}
155
156}
Domain(long left, long right)
Definition: util/Domain.cs:57
static Domain FromValues(long[] values)
Definition: util/Domain.cs:65
static Domain AllValues()
Definition: util/Domain.cs:60
static Domain FromFlatIntervals(long[] flat_intervals)
Definition: util/Domain.cs:79
virtual void Dispose(bool disposing)
Definition: util/Domain.cs:39
override string ToString()
Definition: util/Domain.cs:149
Domain UnionWith(Domain domain)
Definition: util/Domain.cs:137
bool Contains(long value)
Definition: util/Domain.cs:116
Domain AdditionWith(Domain domain)
Definition: util/Domain.cs:143
Domain IntersectionWith(Domain domain)
Definition: util/Domain.cs:131
static Domain FromIntervals(long[][] intervals)
Definition: util/Domain.cs:70
static global::System.IntPtr Domain_AdditionWith(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr Domain_FromFlatIntervals(int length1, long[] jarg1)
static bool Domain_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr Domain_IntersectionWith(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr Domain_AllValues()
static long Domain_Size(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_Domain(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Domain_Complement(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Domain_Negation(global::System.Runtime.InteropServices.HandleRef jarg1)
static long Domain_Min(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool Domain_IsEmpty(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Domain_FlattenedIntervals(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_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 string Domain_ToString(global::System.Runtime.InteropServices.HandleRef jarg1)