Java Reference

Java Reference

LinearSumAssignment.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 LinearSumAssignment {
12  private transient long swigCPtr;
13  protected transient boolean swigCMemOwn;
14 
15  protected LinearSumAssignment(long cPtr, boolean cMemoryOwn) {
16  swigCMemOwn = cMemoryOwn;
17  swigCPtr = cPtr;
18  }
19 
20  protected static long getCPtr(LinearSumAssignment obj) {
21  return (obj == null) ? 0 : obj.swigCPtr;
22  }
23 
24  @SuppressWarnings("deprecation")
25  protected void finalize() {
26  delete();
27  }
28 
29  public synchronized void delete() {
30  if (swigCPtr != 0) {
31  if (swigCMemOwn) {
32  swigCMemOwn = false;
33  mainJNI.delete_LinearSumAssignment(swigCPtr);
34  }
35  swigCPtr = 0;
36  }
37  }
38 
40  this(mainJNI.new_LinearSumAssignment(), true);
41  }
42 
43  public int addArcWithCost(int left_node, int right_node, long cost) {
44  return mainJNI.LinearSumAssignment_addArcWithCost(swigCPtr, this, left_node, right_node, cost);
45  }
46 
47  public int getNumNodes() {
48  return mainJNI.LinearSumAssignment_getNumNodes(swigCPtr, this);
49  }
50 
51  public int getNumArcs() {
52  return mainJNI.LinearSumAssignment_getNumArcs(swigCPtr, this);
53  }
54 
55  public int getLeftNode(int arc) {
56  return mainJNI.LinearSumAssignment_getLeftNode(swigCPtr, this, arc);
57  }
58 
59  public int getRightNode(int arc) {
60  return mainJNI.LinearSumAssignment_getRightNode(swigCPtr, this, arc);
61  }
62 
63  public long getCost(int arc) {
64  return mainJNI.LinearSumAssignment_getCost(swigCPtr, this, arc);
65  }
66 
68  return LinearSumAssignment.Status.swigToEnum(mainJNI.LinearSumAssignment_solve(swigCPtr, this));
69  }
70 
71  public long getOptimalCost() {
72  return mainJNI.LinearSumAssignment_getOptimalCost(swigCPtr, this);
73  }
74 
75  public int getRightMate(int left_node) {
76  return mainJNI.LinearSumAssignment_getRightMate(swigCPtr, this, left_node);
77  }
78 
79  public long getAssignmentCost(int left_node) {
80  return mainJNI.LinearSumAssignment_getAssignmentCost(swigCPtr, this, left_node);
81  }
82 
83  public enum Status {
87 
88  public final int swigValue() {
89  return swigValue;
90  }
91 
92  public static Status swigToEnum(int swigValue) {
93  Status[] swigValues = Status.class.getEnumConstants();
94  if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
95  return swigValues[swigValue];
96  for (Status swigEnum : swigValues)
97  if (swigEnum.swigValue == swigValue)
98  return swigEnum;
99  throw new IllegalArgumentException("No enum " + Status.class + " with value " + swigValue);
100  }
101 
102  @SuppressWarnings("unused")
103  private Status() {
104  this.swigValue = SwigNext.next++;
105  }
106 
107  @SuppressWarnings("unused")
108  private Status(int swigValue) {
109  this.swigValue = swigValue;
110  SwigNext.next = swigValue+1;
111  }
112 
113  @SuppressWarnings("unused")
114  private Status(Status swigEnum) {
115  this.swigValue = swigEnum.swigValue;
116  SwigNext.next = this.swigValue+1;
117  }
118 
119  private final int swigValue;
120 
121  private static class SwigNext {
122  private static int next = 0;
123  }
124  }
125 
126 }
LinearSumAssignment.Status solve()
int getNumArcs()
static Status swigToEnum(int swigValue)
OPTIMAL
long getCost(int arc)
int getRightNode(int arc)
LinearSumAssignment()
final int swigValue()
int getLeftNode(int arc)
long getAssignmentCost(int left_node)
LinearSumAssignment(long cPtr, boolean cMemoryOwn)
INFEASIBLE
long getOptimalCost()
int getRightMate(int left_node)
POSSIBLE_OVERFLOW
int addArcWithCost(int left_node, int right_node, long cost)
int getNumNodes()