Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
MinCostFlow.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.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
9package com.google.ortools.graph;
10
11public 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 static long swigRelease(MinCostFlow obj) {
24 long ptr = 0;
25 if (obj != null) {
26 if (!obj.swigCMemOwn)
27 throw new RuntimeException("Cannot release ownership as memory is not owned");
28 ptr = obj.swigCPtr;
29 obj.swigCMemOwn = false;
30 obj.delete();
31 }
32 return ptr;
33 }
34
35 @SuppressWarnings({"deprecation", "removal"})
36 protected void finalize() {
37 delete();
38 }
39
40 public synchronized void delete() {
41 if (swigCPtr != 0) {
42 if (swigCMemOwn) {
43 swigCMemOwn = false;
44 mainJNI.delete_MinCostFlow(swigCPtr);
45 }
46 swigCPtr = 0;
47 }
48 super.delete();
49 }
50
51 public MinCostFlow(int reserve_num_nodes, int reserve_num_arcs) {
52 this(mainJNI.new_MinCostFlow__SWIG_0(reserve_num_nodes, reserve_num_arcs), true);
53 }
54
55 public MinCostFlow(int reserve_num_nodes) {
56 this(mainJNI.new_MinCostFlow__SWIG_1(reserve_num_nodes), true);
57 }
58
59 public MinCostFlow() {
60 this(mainJNI.new_MinCostFlow__SWIG_2(), true);
61 }
62
63 public int addArcWithCapacityAndUnitCost(int tail, int head, long capacity, long unit_cost) {
64 return mainJNI.MinCostFlow_addArcWithCapacityAndUnitCost(swigCPtr, this, tail, head, capacity, unit_cost);
65 }
66
67 public void setNodeSupply(int node, long supply) {
68 mainJNI.MinCostFlow_setNodeSupply(swigCPtr, this, node, supply);
69 }
70
71 public MinCostFlowBase.Status solve() {
72 return MinCostFlowBase.Status.swigToEnum(mainJNI.MinCostFlow_solve(swigCPtr, this));
73 }
74
75 public MinCostFlowBase.Status solveMaxFlowWithMinCost() {
76 return MinCostFlowBase.Status.swigToEnum(mainJNI.MinCostFlow_solveMaxFlowWithMinCost(swigCPtr, this));
77 }
78
79 public long getOptimalCost() {
80 return mainJNI.MinCostFlow_getOptimalCost(swigCPtr, this);
81 }
82
83 public long getMaximumFlow() {
84 return mainJNI.MinCostFlow_getMaximumFlow(swigCPtr, this);
85 }
86
87 public long getFlow(int arc) {
88 return mainJNI.MinCostFlow_getFlow(swigCPtr, this, arc);
89 }
90
91 public int getNumNodes() {
92 return mainJNI.MinCostFlow_getNumNodes(swigCPtr, this);
93 }
94
95 public int getNumArcs() {
96 return mainJNI.MinCostFlow_getNumArcs(swigCPtr, this);
97 }
98
99 public int getTail(int arc) {
100 return mainJNI.MinCostFlow_getTail(swigCPtr, this, arc);
101 }
102
103 public int getHead(int arc) {
104 return mainJNI.MinCostFlow_getHead(swigCPtr, this, arc);
105 }
106
107 public long getCapacity(int arc) {
108 return mainJNI.MinCostFlow_getCapacity(swigCPtr, this, arc);
109 }
110
111 public long getSupply(int node) {
112 return mainJNI.MinCostFlow_getSupply(swigCPtr, this, node);
113 }
114
115 public long getUnitCost(int arc) {
116 return mainJNI.MinCostFlow_getUnitCost(swigCPtr, this, arc);
117 }
118
119}
static long swigRelease(MinCostFlow obj)
MinCostFlow(int reserve_num_nodes)
void setNodeSupply(int node, long supply)
int addArcWithCapacityAndUnitCost(int tail, int head, long capacity, long unit_cost)
static long getCPtr(MinCostFlow obj)
MinCostFlowBase.Status solveMaxFlowWithMinCost()
MinCostFlow(int reserve_num_nodes, int reserve_num_arcs)
MinCostFlow(long cPtr, boolean cMemoryOwn)
MinCostFlowBase.Status solve()