Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
RoutingIndexManager.cs
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// <auto-generated />
3//
4// This file was automatically generated by SWIG (https://www.swig.org).
5// Version 4.3.0
6//
7// Do not make changes to this file unless you know what you are doing - modify
8// the SWIG interface file instead.
9//------------------------------------------------------------------------------
10
12
13using System;
14using System.Runtime.InteropServices;
15using System.Collections;
16
17public partial class RoutingIndexManager : global::System.IDisposable {
18 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19 protected bool swigCMemOwn;
20
21 internal RoutingIndexManager(global::System.IntPtr cPtr, bool cMemoryOwn) {
22 swigCMemOwn = cMemoryOwn;
23 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24 }
25
26 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RoutingIndexManager obj) {
27 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
28 }
29
30 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(RoutingIndexManager obj) {
31 if (obj != null) {
32 if (!obj.swigCMemOwn)
33 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
34 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
35 obj.swigCMemOwn = false;
36 obj.Dispose();
37 return ptr;
38 } else {
39 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
40 }
41 }
42
43 ~RoutingIndexManager() {
44 Dispose(false);
45 }
46
47 public void Dispose() {
48 Dispose(true);
49 global::System.GC.SuppressFinalize(this);
50 }
51
52 protected virtual void Dispose(bool disposing) {
53 lock(this) {
54 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
55 if (swigCMemOwn) {
56 swigCMemOwn = false;
58 }
59 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
60 }
61 }
62 }
63
64 public RoutingIndexManager(int num_nodes, int num_vehicles, int depot) : this(operations_research_constraint_solverPINVOKE.new_RoutingIndexManager__SWIG_0(num_nodes, num_vehicles, depot), true) {
65 }
67 public RoutingIndexManager(int num_nodes, int num_vehicles, int[] starts, int[] ends) : this(operations_research_constraint_solverPINVOKE.new_RoutingIndexManager__SWIG_1(num_nodes, num_vehicles, starts.Length, starts , ends.Length, ends ), true) {
68 }
70 public int GetNumberOfNodes() {
72 return ret;
73 }
74
75 public int GetNumberOfVehicles() {
77 return ret;
78 }
79
80 public int GetNumberOfIndices() {
82 return ret;
83 }
84
85 public long GetStartIndex(int vehicle) {
87 return ret;
88 }
89
90 public long GetEndIndex(int vehicle) {
92 return ret;
93 }
94
95 public long NodeToIndex(int node) {
97 return ret;
98 }
99
100 public long[] NodesToIndices( int[] nodes) {
101 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.RoutingIndexManager_NodesToIndices(swigCPtr, nodes.Length, nodes );
102 Int64Vector tmpVector = null;
103 if (cPtr != global::System.IntPtr.Zero) {
104 tmpVector = new Int64Vector(cPtr, true);
105 long[] outArray = new long[tmpVector.Count];
106 tmpVector.CopyTo(outArray);
107 return outArray;
108 }
109 return null;
110}
111
112 public int IndexToNode(long index) {
113 return operations_research_constraint_solverPINVOKE.RoutingIndexManager_IndexToNode(swigCPtr, index);
115
116}
117
118}
static long RoutingIndexManager_NodeToIndex(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void delete_RoutingIndexManager(global::System.Runtime.InteropServices.HandleRef jarg1)
static long RoutingIndexManager_GetEndIndex(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static int RoutingIndexManager_GetNumberOfNodes(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr RoutingIndexManager_NodesToIndices(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, int[] jarg2)
static int RoutingIndexManager_GetNumberOfVehicles(global::System.Runtime.InteropServices.HandleRef jarg1)
static int RoutingIndexManager_GetNumberOfIndices(global::System.Runtime.InteropServices.HandleRef jarg1)
static long RoutingIndexManager_GetStartIndex(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)