DotNet Reference

.Net Reference

MaxFlow.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.Graph {
12 
13 public class MaxFlow : global::System.IDisposable {
14  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
15  protected bool swigCMemOwn;
16 
17  internal MaxFlow(global::System.IntPtr cPtr, bool cMemoryOwn) {
18  swigCMemOwn = cMemoryOwn;
19  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
20  }
21 
22  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(MaxFlow obj) {
23  return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
24  }
25 
26  ~MaxFlow() {
27  Dispose(false);
28  }
29 
30  public void Dispose() {
31  Dispose(true);
32  global::System.GC.SuppressFinalize(this);
33  }
34 
35  protected virtual void Dispose(bool disposing) {
36  lock(this) {
37  if (swigCPtr.Handle != global::System.IntPtr.Zero) {
38  if (swigCMemOwn) {
39  swigCMemOwn = false;
41  }
42  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
43  }
44  }
45  }
46 
47  public MaxFlow() : this(operations_research_graphPINVOKE.new_MaxFlow(), true) {
48  }
49 
50  public int AddArcWithCapacity(int tail, int head, long capacity) {
51  int ret = operations_research_graphPINVOKE.MaxFlow_AddArcWithCapacity(swigCPtr, tail, head, capacity);
52  return ret;
53  }
54 
55  public int NumNodes() {
57  return ret;
58  }
59 
60  public int NumArcs() {
62  return ret;
63  }
64 
65  public int Tail(int arc) {
66  int ret = operations_research_graphPINVOKE.MaxFlow_Tail(swigCPtr, arc);
67  return ret;
68  }
69 
70  public int Head(int arc) {
71  int ret = operations_research_graphPINVOKE.MaxFlow_Head(swigCPtr, arc);
72  return ret;
73  }
74 
75  public long Capacity(int arc) {
76  long ret = operations_research_graphPINVOKE.MaxFlow_Capacity(swigCPtr, arc);
77  return ret;
78  }
79 
80  public MaxFlow.Status Solve(int source, int sink) {
82  return ret;
83  }
84 
85  public long OptimalFlow() {
87  return ret;
88  }
89 
90  public long Flow(int arc) {
91  long ret = operations_research_graphPINVOKE.MaxFlow_Flow(swigCPtr, arc);
92  return ret;
93  }
94 
95  public enum Status {
96  OPTIMAL,
97  POSSIBLE_OVERFLOW,
98  BAD_INPUT,
99  BAD_RESULT
100  }
101 
102 }
103 
104 }
MaxFlow.Status Solve(int source, int sink)
Definition: MaxFlow.cs:80
void Dispose()
Definition: MaxFlow.cs:30
static long MaxFlow_OptimalFlow(global::System.Runtime.InteropServices.HandleRef jarg1)
int NumNodes()
Definition: MaxFlow.cs:55
virtual void Dispose(bool disposing)
Definition: MaxFlow.cs:35
int AddArcWithCapacity(int tail, int head, long capacity)
Definition: MaxFlow.cs:50
static int MaxFlow_Solve(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static int MaxFlow_Tail(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
bool swigCMemOwn
Definition: MaxFlow.cs:15
long Flow(int arc)
Definition: MaxFlow.cs:90
using System
Definition: Program.cs:14
Definition: MaxFlow.cs:13
static long MaxFlow_Flow(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
int NumArcs()
Definition: MaxFlow.cs:60
static int MaxFlow_Head(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
Status
Definition: MaxFlow.cs:95
int Head(int arc)
Definition: MaxFlow.cs:70
static void delete_MaxFlow(global::System.Runtime.InteropServices.HandleRef jarg1)
long OptimalFlow()
Definition: MaxFlow.cs:85
static int MaxFlow_NumNodes(global::System.Runtime.InteropServices.HandleRef jarg1)
long Capacity(int arc)
Definition: MaxFlow.cs:75
static int MaxFlow_AddArcWithCapacity(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, long jarg4)
static long MaxFlow_Capacity(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static int MaxFlow_NumArcs(global::System.Runtime.InteropServices.HandleRef jarg1)
MaxFlow()
Definition: MaxFlow.cs:47
int Tail(int arc)
Definition: MaxFlow.cs:65