Java Reference

Java Reference

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.1
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(int reserve_num_nodes, int reserve_num_arcs) {
40  this(mainJNI.new_MinCostFlow__SWIG_0(reserve_num_nodes, reserve_num_arcs), true);
41  }
42 
43  public MinCostFlow(int reserve_num_nodes) {
44  this(mainJNI.new_MinCostFlow__SWIG_1(reserve_num_nodes), true);
45  }
46 
47  public MinCostFlow() {
48  this(mainJNI.new_MinCostFlow__SWIG_2(), true);
49  }
50 
51  public int addArcWithCapacityAndUnitCost(int tail, int head, long capacity, long unit_cost) {
52  return mainJNI.MinCostFlow_addArcWithCapacityAndUnitCost(swigCPtr, this, tail, head, capacity, unit_cost);
53  }
54 
55  public void setNodeSupply(int node, long supply) {
56  mainJNI.MinCostFlow_setNodeSupply(swigCPtr, this, node, supply);
57  }
58 
60  return MinCostFlowBase.Status.swigToEnum(mainJNI.MinCostFlow_solve(swigCPtr, this));
61  }
62 
64  return MinCostFlowBase.Status.swigToEnum(mainJNI.MinCostFlow_solveMaxFlowWithMinCost(swigCPtr, this));
65  }
66 
67  public long getOptimalCost() {
68  return mainJNI.MinCostFlow_getOptimalCost(swigCPtr, this);
69  }
70 
71  public long getMaximumFlow() {
72  return mainJNI.MinCostFlow_getMaximumFlow(swigCPtr, this);
73  }
74 
75  public long getFlow(int arc) {
76  return mainJNI.MinCostFlow_getFlow(swigCPtr, this, arc);
77  }
78 
79  public int getNumNodes() {
80  return mainJNI.MinCostFlow_getNumNodes(swigCPtr, this);
81  }
82 
83  public int getNumArcs() {
84  return mainJNI.MinCostFlow_getNumArcs(swigCPtr, this);
85  }
86 
87  public int getTail(int arc) {
88  return mainJNI.MinCostFlow_getTail(swigCPtr, this, arc);
89  }
90 
91  public int getHead(int arc) {
92  return mainJNI.MinCostFlow_getHead(swigCPtr, this, arc);
93  }
94 
95  public long getCapacity(int arc) {
96  return mainJNI.MinCostFlow_getCapacity(swigCPtr, this, arc);
97  }
98 
99  public long getSupply(int node) {
100  return mainJNI.MinCostFlow_getSupply(swigCPtr, this, node);
101  }
102 
103  public long getUnitCost(int arc) {
104  return mainJNI.MinCostFlow_getUnitCost(swigCPtr, this, arc);
105  }
106 
107 }
static Status swigToEnum(int swigValue)
long getCapacity(int arc)
long getMaximumFlow()
MinCostFlow(long cPtr, boolean cMemoryOwn)
int getNumNodes()
MinCostFlow()
int getHead(int arc)
long getUnitCost(int arc)
void setNodeSupply(int node, long supply)
int addArcWithCapacityAndUnitCost(int tail, int head, long capacity, long unit_cost)
MinCostFlowBase.Status solveMaxFlowWithMinCost()
long getFlow(int arc)
long getOptimalCost()
long getSupply(int node)
int getTail(int arc)
int getNumArcs()
MinCostFlow(int reserve_num_nodes)
MinCostFlow(int reserve_num_nodes, int reserve_num_arcs)
MinCostFlowBase.Status solve()