MinCostFlow.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.12
4  *
5  * Do not make changes to this file unless you know what you are doing--modify
6  * the SWIG interface file instead.
7  * ----------------------------------------------------------------------------- */
8 
9 package com.google.ortools.graph;
10 
11 public class MinCostFlow extends MinCostFlowBase {
12  private transient long swigCPtr;
13 
14  protected MinCostFlow(long cPtr, boolean cMemoryOwn) {
15  super(mainJNI.MinCostFlow_SWIGUpcast(cPtr), cMemoryOwn);
16  swigCPtr = cPtr;
17  }
18 
19  protected static long getCPtr(MinCostFlow obj) {
20  return (obj == null) ? 0 : obj.swigCPtr;
21  }
22 
23  protected void finalize() {
24  delete();
25  }
26 
27  public synchronized void delete() {
28  if (swigCPtr != 0) {
29  if (swigCMemOwn) {
30  swigCMemOwn = false;
31  mainJNI.delete_MinCostFlow(swigCPtr);
32  }
33  swigCPtr = 0;
34  }
35  super.delete();
36  }
37 
38  public MinCostFlow() {
39  this(mainJNI.new_MinCostFlow(), true);
40  }
41 
42  public int addArcWithCapacityAndUnitCost(int tail, int head, long capacity, long unit_cost) {
43  return mainJNI.MinCostFlow_addArcWithCapacityAndUnitCost(swigCPtr, this, tail, head, capacity, unit_cost);
44  }
45 
46  public void setNodeSupply(int node, long supply) {
47  mainJNI.MinCostFlow_setNodeSupply(swigCPtr, this, node, supply);
48  }
49 
51  return MinCostFlowBase.Status.swigToEnum(mainJNI.MinCostFlow_solve(swigCPtr, this));
52  }
53 
55  return MinCostFlowBase.Status.swigToEnum(mainJNI.MinCostFlow_solveMaxFlowWithMinCost(swigCPtr, this));
56  }
57 
58  public long getOptimalCost() {
59  return mainJNI.MinCostFlow_getOptimalCost(swigCPtr, this);
60  }
61 
62  public long getMaximumFlow() {
63  return mainJNI.MinCostFlow_getMaximumFlow(swigCPtr, this);
64  }
65 
66  public long getFlow(int arc) {
67  return mainJNI.MinCostFlow_getFlow(swigCPtr, this, arc);
68  }
69 
70  public int getNumNodes() {
71  return mainJNI.MinCostFlow_getNumNodes(swigCPtr, this);
72  }
73 
74  public int getNumArcs() {
75  return mainJNI.MinCostFlow_getNumArcs(swigCPtr, this);
76  }
77 
78  public int getTail(int arc) {
79  return mainJNI.MinCostFlow_getTail(swigCPtr, this, arc);
80  }
81 
82  public int getHead(int arc) {
83  return mainJNI.MinCostFlow_getHead(swigCPtr, this, arc);
84  }
85 
86  public long getCapacity(int arc) {
87  return mainJNI.MinCostFlow_getCapacity(swigCPtr, this, arc);
88  }
89 
90  public long getSupply(int node) {
91  return mainJNI.MinCostFlow_getSupply(swigCPtr, this, node);
92  }
93 
94  public long getUnitCost(int arc) {
95  return mainJNI.MinCostFlow_getUnitCost(swigCPtr, this, arc);
96  }
97 
98 }
static long getCPtr(MinCostFlow obj)
void setNodeSupply(int node, long supply)
MinCostFlow(long cPtr, boolean cMemoryOwn)
MinCostFlowBase.Status solveMaxFlowWithMinCost()
int addArcWithCapacityAndUnitCost(int tail, int head, long capacity, long unit_cost)
MinCostFlowBase.Status solve()