MinCostFlow.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.0
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  @SuppressWarnings("deprecation")
24  protected void finalize() {
25  delete();
26  }
27 
28  public synchronized void delete() {
29  if (swigCPtr != 0) {
30  if (swigCMemOwn) {
31  swigCMemOwn = false;
32  mainJNI.delete_MinCostFlow(swigCPtr);
33  }
34  swigCPtr = 0;
35  }
36  super.delete();
37  }
38 
39  public MinCostFlow() {
40  this(mainJNI.new_MinCostFlow(), true);
41  }
42 
43  public int addArcWithCapacityAndUnitCost(int tail, int head, long capacity, long unit_cost) {
44  return mainJNI.MinCostFlow_addArcWithCapacityAndUnitCost(swigCPtr, this, tail, head, capacity, unit_cost);
45  }
46 
47  public void setNodeSupply(int node, long supply) {
48  mainJNI.MinCostFlow_setNodeSupply(swigCPtr, this, node, supply);
49  }
50 
52  return MinCostFlowBase.Status.swigToEnum(mainJNI.MinCostFlow_solve(swigCPtr, this));
53  }
54 
56  return MinCostFlowBase.Status.swigToEnum(mainJNI.MinCostFlow_solveMaxFlowWithMinCost(swigCPtr, this));
57  }
58 
59  public long getOptimalCost() {
60  return mainJNI.MinCostFlow_getOptimalCost(swigCPtr, this);
61  }
62 
63  public long getMaximumFlow() {
64  return mainJNI.MinCostFlow_getMaximumFlow(swigCPtr, this);
65  }
66 
67  public long getFlow(int arc) {
68  return mainJNI.MinCostFlow_getFlow(swigCPtr, this, arc);
69  }
70 
71  public int getNumNodes() {
72  return mainJNI.MinCostFlow_getNumNodes(swigCPtr, this);
73  }
74 
75  public int getNumArcs() {
76  return mainJNI.MinCostFlow_getNumArcs(swigCPtr, this);
77  }
78 
79  public int getTail(int arc) {
80  return mainJNI.MinCostFlow_getTail(swigCPtr, this, arc);
81  }
82 
83  public int getHead(int arc) {
84  return mainJNI.MinCostFlow_getHead(swigCPtr, this, arc);
85  }
86 
87  public long getCapacity(int arc) {
88  return mainJNI.MinCostFlow_getCapacity(swigCPtr, this, arc);
89  }
90 
91  public long getSupply(int node) {
92  return mainJNI.MinCostFlow_getSupply(swigCPtr, this, node);
93  }
94 
95  public long getUnitCost(int arc) {
96  return mainJNI.MinCostFlow_getUnitCost(swigCPtr, this, arc);
97  }
98 
99 }
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()