LinearSumAssignment.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 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  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_LinearSumAssignment(swigCPtr);
33  }
34  swigCPtr = 0;
35  }
36  }
37 
39  this(mainJNI.new_LinearSumAssignment(), true);
40  }
41 
42  public int addArcWithCost(int left_node, int right_node, long cost) {
43  return mainJNI.LinearSumAssignment_addArcWithCost(swigCPtr, this, left_node, right_node, cost);
44  }
45 
46  public int getNumNodes() {
47  return mainJNI.LinearSumAssignment_getNumNodes(swigCPtr, this);
48  }
49 
50  public int getNumArcs() {
51  return mainJNI.LinearSumAssignment_getNumArcs(swigCPtr, this);
52  }
53 
54  public int getLeftNode(int arc) {
55  return mainJNI.LinearSumAssignment_getLeftNode(swigCPtr, this, arc);
56  }
57 
58  public int getRightNode(int arc) {
59  return mainJNI.LinearSumAssignment_getRightNode(swigCPtr, this, arc);
60  }
61 
62  public long getCost(int arc) {
63  return mainJNI.LinearSumAssignment_getCost(swigCPtr, this, arc);
64  }
65 
67  return LinearSumAssignment.Status.swigToEnum(mainJNI.LinearSumAssignment_solve(swigCPtr, this));
68  }
69 
70  public long getOptimalCost() {
71  return mainJNI.LinearSumAssignment_getOptimalCost(swigCPtr, this);
72  }
73 
74  public int getRightMate(int left_node) {
75  return mainJNI.LinearSumAssignment_getRightMate(swigCPtr, this, left_node);
76  }
77 
78  public long getAssignmentCost(int left_node) {
79  return mainJNI.LinearSumAssignment_getAssignmentCost(swigCPtr, this, left_node);
80  }
81 
82  public enum Status {
86 
87  public final int swigValue() {
88  return swigValue;
89  }
90 
91  public static Status swigToEnum(int swigValue) {
92  Status[] swigValues = Status.class.getEnumConstants();
93  if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
94  return swigValues[swigValue];
95  for (Status swigEnum : swigValues)
96  if (swigEnum.swigValue == swigValue)
97  return swigEnum;
98  throw new IllegalArgumentException("No enum " + Status.class + " with value " + swigValue);
99  }
100 
101  @SuppressWarnings("unused")
102  private Status() {
103  this.swigValue = SwigNext.next++;
104  }
105 
106  @SuppressWarnings("unused")
107  private Status(int swigValue) {
108  this.swigValue = swigValue;
109  SwigNext.next = swigValue+1;
110  }
111 
112  @SuppressWarnings("unused")
113  private Status(Status swigEnum) {
114  this.swigValue = swigEnum.swigValue;
115  SwigNext.next = this.swigValue+1;
116  }
117 
118  private final int swigValue;
119 
120  private static class SwigNext {
121  private static int next = 0;
122  }
123  }
124 
125 }
LinearSumAssignment(long cPtr, boolean cMemoryOwn)
int addArcWithCost(int left_node, int right_node, long cost)
static long getCPtr(LinearSumAssignment obj)