Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
RoutingIndexManager.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.constraintsolver;
10
34public class RoutingIndexManager {
35 private transient long swigCPtr;
36 protected transient boolean swigCMemOwn;
37
38 protected RoutingIndexManager(long cPtr, boolean cMemoryOwn) {
39 swigCMemOwn = cMemoryOwn;
40 swigCPtr = cPtr;
41 }
42
43 protected static long getCPtr(RoutingIndexManager obj) {
44 return (obj == null) ? 0 : obj.swigCPtr;
45 }
46
47 protected static long swigRelease(RoutingIndexManager obj) {
48 long ptr = 0;
49 if (obj != null) {
50 if (!obj.swigCMemOwn)
51 throw new RuntimeException("Cannot release ownership as memory is not owned");
52 ptr = obj.swigCPtr;
53 obj.swigCMemOwn = false;
54 obj.delete();
55 }
56 return ptr;
57 }
58
59 @SuppressWarnings({"deprecation", "removal"})
60 protected void finalize() {
61 delete();
62 }
63
64 public synchronized void delete() {
65 if (swigCPtr != 0) {
66 if (swigCMemOwn) {
67 swigCMemOwn = false;
68 mainJNI.delete_RoutingIndexManager(swigCPtr);
69 }
70 swigCPtr = 0;
71 }
72 }
73
80 public RoutingIndexManager(int num_nodes, int num_vehicles, int depot) {
81 this(mainJNI.new_RoutingIndexManager__SWIG_0(num_nodes, num_vehicles, depot), true);
82 }
83
84 public RoutingIndexManager(int num_nodes, int num_vehicles, int[] starts, int[] ends) {
85 this(mainJNI.new_RoutingIndexManager__SWIG_1(num_nodes, num_vehicles, starts, ends), true);
86 }
87
88 public int getNumberOfNodes() {
89 return mainJNI.RoutingIndexManager_getNumberOfNodes(swigCPtr, this);
90 }
91
92 public int getNumberOfVehicles() {
93 return mainJNI.RoutingIndexManager_getNumberOfVehicles(swigCPtr, this);
94 }
95
96 public int getNumberOfIndices() {
97 return mainJNI.RoutingIndexManager_getNumberOfIndices(swigCPtr, this);
98 }
99
100 public long getStartIndex(int vehicle) {
101 return mainJNI.RoutingIndexManager_getStartIndex(swigCPtr, this, vehicle);
102 }
103
104 public long getEndIndex(int vehicle) {
105 return mainJNI.RoutingIndexManager_getEndIndex(swigCPtr, this, vehicle);
106 }
107
108 public long nodeToIndex(int node) {
109 return mainJNI.RoutingIndexManager_nodeToIndex(swigCPtr, this, node);
110 }
111
112 public long[] nodesToIndices(int[] nodes) {
113 return mainJNI.RoutingIndexManager_nodesToIndices(swigCPtr, this, nodes);
114}
115
116 public int indexToNode(long index) {
117 return mainJNI.RoutingIndexManager_indexToNode(swigCPtr, this, index);
118}
119
120}
RoutingIndexManager(int num_nodes, int num_vehicles, int depot)
RoutingIndexManager(int num_nodes, int num_vehicles, int[] starts, int[] ends)